From 2e15d48447542e74186289810d24e080b550c131 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 18 Nov 2016 22:10:33 +0100 Subject: [PATCH] v8: drop v8::FunctionCallbackInfo::NewTarget() Remove the new method that was introduced in the back-port of v8/v8@306c412c ("[api] Expose FunctionCallbackInfo::NewTarget") so that the meat of the patch can land in a patch release. This commit can be reverted again in the next minor release. Fixes: https://github.com/nodejs/node/issues/9288 PR-URL: https://github.com/nodejs/node/pull/9293 Reviewed-By: Ali Ijaz Sheikh Reviewed-By: James M Snell Reviewed-By: Myles Borins --- deps/v8/include/v8.h | 7 ------- deps/v8/test/cctest/test-api.cc | 37 --------------------------------- 2 files changed, 44 deletions(-) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index ec45c91d77e728..c842b01587961d 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -3177,7 +3177,6 @@ class FunctionCallbackInfo { Local Callee() const); V8_INLINE Local This() const; V8_INLINE Local Holder() const; - V8_INLINE Local NewTarget() const; V8_INLINE bool IsConstructCall() const; V8_INLINE Local Data() const; V8_INLINE Isolate* GetIsolate() const; @@ -7904,12 +7903,6 @@ Local FunctionCallbackInfo::Holder() const { &implicit_args_[kHolderIndex])); } -template -Local FunctionCallbackInfo::NewTarget() const { - return Local( - reinterpret_cast(&implicit_args_[kNewTargetIndex])); -} - template Local FunctionCallbackInfo::Data() const { return Local(reinterpret_cast(&implicit_args_[kDataIndex])); diff --git a/deps/v8/test/cctest/test-api.cc b/deps/v8/test/cctest/test-api.cc index a44239c244f4a5..e27f469e0c0aef 100644 --- a/deps/v8/test/cctest/test-api.cc +++ b/deps/v8/test/cctest/test-api.cc @@ -13350,43 +13350,6 @@ THREADED_TEST(IsConstructCall) { CHECK(value->BooleanValue(context.local()).FromJust()); } -static void NewTargetHandler(const v8::FunctionCallbackInfo& args) { - ApiTestFuzzer::Fuzz(); - args.GetReturnValue().Set(args.NewTarget()); -} - -THREADED_TEST(NewTargetHandler) { - v8::Isolate* isolate = CcTest::isolate(); - v8::HandleScope scope(isolate); - - // Function template with call handler. - Local templ = v8::FunctionTemplate::New(isolate); - templ->SetCallHandler(NewTargetHandler); - - LocalContext context; - - Local function = - templ->GetFunction(context.local()).ToLocalChecked(); - CHECK(context->Global() - ->Set(context.local(), v8_str("f"), function) - .FromJust()); - Local value = CompileRun("f()"); - CHECK(value->IsUndefined()); - value = CompileRun("new f()"); - CHECK(value->IsFunction()); - CHECK(value == function); - Local subclass = CompileRun("var g = class extends f { }; g"); - CHECK(subclass->IsFunction()); - value = CompileRun("new g()"); - CHECK(value->IsFunction()); - CHECK(value == subclass); - value = CompileRun("Reflect.construct(f, [], Array)"); - CHECK(value->IsFunction()); - CHECK(value == - context->Global() - ->Get(context.local(), v8_str("Array")) - .ToLocalChecked()); -} THREADED_TEST(ObjectProtoToString) { v8::Isolate* isolate = CcTest::isolate();