xref: /third_party/node/test/addons/errno-exception/binding.cc
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/errno-exception/
11cb0ef41Sopenharmony_ci#include <node.h>
21cb0ef41Sopenharmony_ci#include <v8.h>
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_civoid Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
51cb0ef41Sopenharmony_ci  v8::Isolate* isolate = args.GetIsolate();
61cb0ef41Sopenharmony_ci  v8::HandleScope scope(isolate);
71cb0ef41Sopenharmony_ci  args.GetReturnValue().Set(node::ErrnoException(isolate,
81cb0ef41Sopenharmony_ci                                                10,
91cb0ef41Sopenharmony_ci                                                "syscall",
101cb0ef41Sopenharmony_ci                                                "some error msg",
111cb0ef41Sopenharmony_ci                                                "päth"));
121cb0ef41Sopenharmony_ci}
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_civoid init(v8::Local<v8::Object> exports) {
151cb0ef41Sopenharmony_ci  NODE_SET_METHOD(exports, "errno", Method);
161cb0ef41Sopenharmony_ci}
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ciNODE_MODULE(NODE_GYP_MODULE_NAME, init)
19

Indexes created Thu Nov 07 10:32:03 CST 2024