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

Side by Side 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, 9 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 unified diff | Download patch
« src/execution.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 24961 matching lines...) Expand 10 before | Expand all | Expand 10 after
24972 CHECK(proxy->GetTarget()->SameValue(target)); 24972 CHECK(proxy->GetTarget()->SameValue(target));
24973 CHECK(proxy->GetHandler()->SameValue(handler)); 24973 CHECK(proxy->GetHandler()->SameValue(handler));
24974 24974
24975 proxy->Revoke(); 24975 proxy->Revoke();
24976 CHECK(proxy->IsProxy()); 24976 CHECK(proxy->IsProxy());
24977 CHECK(!target->IsProxy()); 24977 CHECK(!target->IsProxy());
24978 CHECK(proxy->IsRevoked()); 24978 CHECK(proxy->IsRevoked());
24979 CHECK(proxy->GetTarget()->SameValue(target)); 24979 CHECK(proxy->GetTarget()->SameValue(target));
24980 CHECK(proxy->GetHandler()->IsNull()); 24980 CHECK(proxy->GetHandler()->IsNull());
24981 } 24981 }
24982
24983 void EmptyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) {}
24984
24985 TEST(CallOnNonConstructableFunction) {
24986 LocalContext context;
24987 v8::Isolate* isolate = CcTest::isolate();
24988 v8::HandleScope scope(isolate);
24989
24990 v8::Local<v8::FunctionTemplate> tmpl =
24991 v8::FunctionTemplate::New(isolate, EmptyFunction);
24992 tmpl->RemovePrototype();
24993 v8::Local<v8::Function> fun =
24994 tmpl->GetFunction(context.local()).ToLocalChecked();
24995 CHECK(
24996 !fun->CallAsFunction(context.local(), v8::Undefined(isolate), 0, nullptr)
24997 .IsEmpty());
24998 }
OLDNEW
« 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