From 2eb2c9c82c6048fbef753c79d3fc6398cf8b530b Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Fri, 3 Aug 2018 00:53:40 +0530 Subject: [PATCH 1/3] src: remove calls to deprecated v8 functions (NumberValue) Remove all calls to deprecated v8 functions (here: Value::NumberValue) inside the code (src directory only). --- src/async_wrap.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 7ef3dafdf992c5..6b84140457a66f 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -410,7 +410,12 @@ void AsyncWrap::PopAsyncIds(const FunctionCallbackInfo& args) { void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { AsyncWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - double execution_async_id = args[0]->IsNumber() ? args[0]->NumberValue() : -1; + double execution_async_id = + args[0]->IsNumber() + ? args[0] + ->NumberValue(args.GetIsolate()->GetCurrentContext()) + .ToChecked() + : -1; wrap->AsyncReset(execution_async_id); } @@ -418,7 +423,8 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { void AsyncWrap::QueueDestroyAsyncId(const FunctionCallbackInfo& args) { CHECK(args[0]->IsNumber()); AsyncWrap::EmitDestroy( - Environment::GetCurrent(args), args[0]->NumberValue()); + Environment::GetCurrent(args), + args[0]->NumberValue(args.GetIsolate()->GetCurrentContext()).ToChecked()); } void AsyncWrap::AddWrapMethods(Environment* env, From feb53d11cf7e00c2075609a48993f9e6da1c4aeb Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Fri, 3 Aug 2018 18:25:01 +0530 Subject: [PATCH 2/3] fixup! src: remove calls to deprecated v8 functions (NumberValue) --- src/async_wrap.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 6b84140457a66f..65f47841bbbe38 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -411,11 +411,7 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { AsyncWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); double execution_async_id = - args[0]->IsNumber() - ? args[0] - ->NumberValue(args.GetIsolate()->GetCurrentContext()) - .ToChecked() - : -1; + args[0]->IsNumber() ? args[0].As()->Value() : -1; wrap->AsyncReset(execution_async_id); } From 8a5affd01fe49ee505ed1fab69a7a185928f73c2 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Sun, 5 Aug 2018 00:13:28 +0530 Subject: [PATCH 3/3] fixup! src: remove calls to deprecated v8 functions (NumberValue) --- src/async_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 65f47841bbbe38..46d63694dee1a2 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -420,7 +420,7 @@ void AsyncWrap::QueueDestroyAsyncId(const FunctionCallbackInfo& args) { CHECK(args[0]->IsNumber()); AsyncWrap::EmitDestroy( Environment::GetCurrent(args), - args[0]->NumberValue(args.GetIsolate()->GetCurrentContext()).ToChecked()); + args[0].As()->Value()); } void AsyncWrap::AddWrapMethods(Environment* env,