xref: /third_party/node/test/addons/hello-world-function-export/binding.cc (revision 1cb0ef41)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/hello-world-function-export/
1#include <node.h>
2#include <v8.h>
3
4void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
5  v8::Isolate* isolate = args.GetIsolate();
6  args.GetReturnValue().Set(v8::String::NewFromUtf8(
7        isolate, "world").ToLocalChecked());
8}
9
10void init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) {
11  NODE_SET_METHOD(module, "exports", Method);
12}
13
14NODE_MODULE(NODE_GYP_MODULE_NAME, init)
15

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