OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |