Skip to content

Commit b8ca616

Browse files
danbevMylesBorins
authored andcommitted
test: fix compiler warnings in callback-scope
Currently there are two compiler warnings generated from the addons test callback-scope: ../binding.cc:44:10: warning: 'Resolve' is deprecated [-Wdeprecated-declarations] local->Resolve(v8::Undefined(isolate)); ^ ../../../../deps/v8/include/v8.h:3893:45: note: 'Resolve' has been explicitly marked deprecated here V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value)); ^ ../binding.cc:52:54: warning: 'New' is deprecated [-Wdeprecated-declarations] persistent.Reset(isolate, v8::Promise::Resolver::New(isolate)); ^ ../../../../deps/v8/include/v8.h:3880:42: note: 'New' has been explicitly marked deprecated here Local<Resolver> New(Isolate* isolate)); This commit updates the test to use non-deprecated functions. PR-URL: #19252 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent d3bc72e commit b8ca616

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/addons/callback-scope/binding.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ static void Callback(uv_work_t* req, int ignored) {
4141

4242
v8::Local<v8::Promise::Resolver> local =
4343
v8::Local<v8::Promise::Resolver>::New(isolate, persistent);
44-
local->Resolve(v8::Undefined(isolate));
44+
local->Resolve(isolate->GetCurrentContext(),
45+
v8::Undefined(isolate)).ToChecked();
4546
delete req;
4647
}
4748

4849
static void TestResolveAsync(const v8::FunctionCallbackInfo<v8::Value>& args) {
4950
v8::Isolate* isolate = args.GetIsolate();
5051

5152
if (persistent.IsEmpty()) {
52-
persistent.Reset(isolate, v8::Promise::Resolver::New(isolate));
53+
persistent.Reset(isolate, v8::Promise::Resolver::New(
54+
isolate->GetCurrentContext()).ToLocalChecked());
5355

5456
uv_work_t* req = new uv_work_t;
5557

0 commit comments

Comments
 (0)