Skip to content

Commit 2e15d48

Browse files
bnoordhuisMylesBorins
authored andcommitted
v8: drop v8::FunctionCallbackInfo<T>::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: #9288 PR-URL: #9293 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 254cb1c commit 2e15d48

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

deps/v8/include/v8.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3177,7 +3177,6 @@ class FunctionCallbackInfo {
31773177
Local<Function> Callee() const);
31783178
V8_INLINE Local<Object> This() const;
31793179
V8_INLINE Local<Object> Holder() const;
3180-
V8_INLINE Local<Value> NewTarget() const;
31813180
V8_INLINE bool IsConstructCall() const;
31823181
V8_INLINE Local<Value> Data() const;
31833182
V8_INLINE Isolate* GetIsolate() const;
@@ -7904,12 +7903,6 @@ Local<Object> FunctionCallbackInfo<T>::Holder() const {
79047903
&implicit_args_[kHolderIndex]));
79057904
}
79067905

7907-
template<typename T>
7908-
Local<Value> FunctionCallbackInfo<T>::NewTarget() const {
7909-
return Local<Value>(
7910-
reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex]));
7911-
}
7912-
79137906
template<typename T>
79147907
Local<Value> FunctionCallbackInfo<T>::Data() const {
79157908
return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));

deps/v8/test/cctest/test-api.cc

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13350,43 +13350,6 @@ THREADED_TEST(IsConstructCall) {
1335013350
CHECK(value->BooleanValue(context.local()).FromJust());
1335113351
}
1335213352

13353-
static void NewTargetHandler(const v8::FunctionCallbackInfo<v8::Value>& args) {
13354-
ApiTestFuzzer::Fuzz();
13355-
args.GetReturnValue().Set(args.NewTarget());
13356-
}
13357-
13358-
THREADED_TEST(NewTargetHandler) {
13359-
v8::Isolate* isolate = CcTest::isolate();
13360-
v8::HandleScope scope(isolate);
13361-
13362-
// Function template with call handler.
13363-
Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate);
13364-
templ->SetCallHandler(NewTargetHandler);
13365-
13366-
LocalContext context;
13367-
13368-
Local<Function> function =
13369-
templ->GetFunction(context.local()).ToLocalChecked();
13370-
CHECK(context->Global()
13371-
->Set(context.local(), v8_str("f"), function)
13372-
.FromJust());
13373-
Local<Value> value = CompileRun("f()");
13374-
CHECK(value->IsUndefined());
13375-
value = CompileRun("new f()");
13376-
CHECK(value->IsFunction());
13377-
CHECK(value == function);
13378-
Local<Value> subclass = CompileRun("var g = class extends f { }; g");
13379-
CHECK(subclass->IsFunction());
13380-
value = CompileRun("new g()");
13381-
CHECK(value->IsFunction());
13382-
CHECK(value == subclass);
13383-
value = CompileRun("Reflect.construct(f, [], Array)");
13384-
CHECK(value->IsFunction());
13385-
CHECK(value ==
13386-
context->Global()
13387-
->Get(context.local(), v8_str("Array"))
13388-
.ToLocalChecked());
13389-
}
1339013353

1339113354
THREADED_TEST(ObjectProtoToString) {
1339213355
v8::Isolate* isolate = CcTest::isolate();

0 commit comments

Comments
 (0)