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/48479/merge
Edigleysson Silva (Edy) 2024-12-09 14:43:50 -03:00 committed by GitHub
parent 80c0055e38
commit 0a7eeb5068
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -72,6 +72,7 @@ namespace demo {
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::NewStringType;
using v8::Object;
using v8::String;
using v8::Value;
@ -79,7 +80,7 @@ using v8::Value;
void Method(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
args.GetReturnValue().Set(String::NewFromUtf8(
isolate, "world").ToLocalChecked());
isolate, "world", NewStringType::kNormal).ToLocalChecked());
}
void Initialize(Local<Object> exports) {