From 114a3e5a05e0aa2e8fe48285ecffa011397be948 Mon Sep 17 00:00:00 2001 From: "Edigleysson Silva (Edy)" Date: Mon, 9 Dec 2024 14:43:50 -0300 Subject: [PATCH] doc: fix c++ addon hello world sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/56172 Refs: https://github.com/nodejs/node/issues/56173 Reviewed-By: Juan José Arboleda Reviewed-By: theanarkh --- doc/api/addons.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index e0e00dca0b9e8b..8e2864952e0841 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -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& args) { Isolate* isolate = args.GetIsolate(); args.GetReturnValue().Set(String::NewFromUtf8( - isolate, "world").ToLocalChecked()); + isolate, "world", NewStringType::kNormal).ToLocalChecked()); } void Initialize(Local exports) {