Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: test/cctest/test-api.cc

Issue 1756973002: Reland "[api] Don't go to javascript to construct API functions" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/execution.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index b0d80ed49a7d9a2da309aaa969e736a4ead97a83..21da1bfc136295fb51d4117c6fb0492d1b2bd037 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -24979,3 +24979,20 @@ TEST(Proxy) {
CHECK(proxy->GetTarget()->SameValue(target));
CHECK(proxy->GetHandler()->IsNull());
}
+
+void EmptyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) {}
+
+TEST(CallOnNonConstructableFunction) {
+ LocalContext context;
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+
+ v8::Local<v8::FunctionTemplate> tmpl =
+ v8::FunctionTemplate::New(isolate, EmptyFunction);
+ tmpl->RemovePrototype();
+ v8::Local<v8::Function> fun =
+ tmpl->GetFunction(context.local()).ToLocalChecked();
+ CHECK(
+ !fun->CallAsFunction(context.local(), v8::Undefined(isolate), 0, nullptr)
+ .IsEmpty());
+}
« src/execution.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698