mirror of https://github.com/nodejs/node.git
doc: fix c++ addon hello world sample
PR-URL: https://github.com/nodejs/node/pull/56172 Refs: https://github.com/nodejs/node/issues/56173 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: theanarkh <theratliter@gmail.com>pull/56329/head
parent
d6e1efcc59
commit
39ce902e58
|
@ -72,6 +72,7 @@ namespace demo {
|
||||||
using v8::FunctionCallbackInfo;
|
using v8::FunctionCallbackInfo;
|
||||||
using v8::Isolate;
|
using v8::Isolate;
|
||||||
using v8::Local;
|
using v8::Local;
|
||||||
|
using v8::NewStringType;
|
||||||
using v8::Object;
|
using v8::Object;
|
||||||
using v8::String;
|
using v8::String;
|
||||||
using v8::Value;
|
using v8::Value;
|
||||||
|
@ -79,7 +80,7 @@ using v8::Value;
|
||||||
void Method(const FunctionCallbackInfo<Value>& args) {
|
void Method(const FunctionCallbackInfo<Value>& args) {
|
||||||
Isolate* isolate = args.GetIsolate();
|
Isolate* isolate = args.GetIsolate();
|
||||||
args.GetReturnValue().Set(String::NewFromUtf8(
|
args.GetReturnValue().Set(String::NewFromUtf8(
|
||||||
isolate, "world").ToLocalChecked());
|
isolate, "world", NewStringType::kNormal).ToLocalChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Initialize(Local<Object> exports) {
|
void Initialize(Local<Object> exports) {
|
||||||
|
|
Loading…
Reference in New Issue