aboutsummaryrefslogtreecommitdiff
path: root/test/addons/dlopen-ping-pong
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-11-07 07:50:51 +0100
committerRich Trott <rtrott@gmail.com>2018-11-09 21:26:31 -0800
commitd58a0c628591a318b4692355f4a08140e17d61df (patch)
tree06ddbfef39956692b63530c252368710945c2b83 /test/addons/dlopen-ping-pong
parenta67e0a6fd21d09c3bca2c6211109e5be980b0b9d (diff)
downloadandroid-node-v8-d58a0c628591a318b4692355f4a08140e17d61df.tar.gz
android-node-v8-d58a0c628591a318b4692355f4a08140e17d61df.tar.bz2
android-node-v8-d58a0c628591a318b4692355f4a08140e17d61df.zip
test: fix NewFromUtf8 compiler warning
Currently there are a number of compiler warnings like the following: ../binding.cc:6:41: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations] args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); ^ /node/deps/v8/include/v8.h:2883:10: note: 'NewFromUtf8' has been explicitly marked deprecated here static V8_DEPRECATE_SOON( ^ /node/deps/v8/include/v8config.h:341:29: note: expanded from macro 'V8_DEPRECATE_SOON' declarator __attribute__((deprecated(message))) ^ This commit updates the code to use the maybe versions. PR-URL: https://github.com/nodejs/node/pull/24216 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/addons/dlopen-ping-pong')
-rw-r--r--test/addons/dlopen-ping-pong/binding.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/addons/dlopen-ping-pong/binding.cc b/test/addons/dlopen-ping-pong/binding.cc
index a3b9af1b80..6a6c297b52 100644
--- a/test/addons/dlopen-ping-pong/binding.cc
+++ b/test/addons/dlopen-ping-pong/binding.cc
@@ -15,6 +15,7 @@ using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
+using v8::NewStringType;
using v8::String;
using v8::Value;
@@ -33,7 +34,8 @@ void LoadLibrary(const FunctionCallbackInfo<Value>& args) {
void Ping(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
assert(ping_func != nullptr);
- args.GetReturnValue().Set(String::NewFromUtf8(isolate, ping_func()));
+ args.GetReturnValue().Set(String::NewFromUtf8(
+ isolate, ping_func(), NewStringType::kNormal).ToLocalChecked());
}
void init(Local<Object> exports) {