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 22154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22165 ->GetFunction(context.local()) | 22165 ->GetFunction(context.local()) |
22166 .ToLocalChecked(); | 22166 .ToLocalChecked(); |
22167 global->Set(context.local(), v8_str("x"), function).FromJust(); | 22167 global->Set(context.local(), v8_str("x"), function).FromJust(); |
22168 | 22168 |
22169 auto result = CompileRun("x()"); | 22169 auto result = CompileRun("x()"); |
22170 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); | 22170 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); |
22171 | 22171 |
22172 result = CompileRun("x(1,2,3)"); | 22172 result = CompileRun("x(1,2,3)"); |
22173 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); | 22173 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); |
22174 | 22174 |
| 22175 result = CompileRun("x.call(undefined)"); |
| 22176 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); |
| 22177 |
| 22178 result = CompileRun("x.call(null)"); |
| 22179 CHECK(v8::Utils::OpenHandle(*result)->IsJSGlobalProxy()); |
| 22180 |
22175 result = CompileRun("7 + x.call(3) + 11"); | 22181 result = CompileRun("7 + x.call(3) + 11"); |
22176 CHECK(result->IsInt32()); | 22182 CHECK(result->IsInt32()); |
22177 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); | 22183 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); |
22178 | 22184 |
22179 result = CompileRun("7 + x.call(3, 101, 102, 103, 104) + 11"); | 22185 result = CompileRun("7 + x.call(3, 101, 102, 103, 104) + 11"); |
22180 CHECK(result->IsInt32()); | 22186 CHECK(result->IsInt32()); |
22181 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); | 22187 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); |
22182 | 22188 |
22183 result = CompileRun("var y = []; x.call(y)"); | 22189 result = CompileRun("var y = []; x.call(y)"); |
22184 CHECK(result->IsArray()); | 22190 CHECK(result->IsArray()); |
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24338 CHECK(proxy->GetTarget()->SameValue(target)); | 24344 CHECK(proxy->GetTarget()->SameValue(target)); |
24339 CHECK(proxy->GetHandler()->SameValue(handler)); | 24345 CHECK(proxy->GetHandler()->SameValue(handler)); |
24340 | 24346 |
24341 proxy->Revoke(); | 24347 proxy->Revoke(); |
24342 CHECK(proxy->IsProxy()); | 24348 CHECK(proxy->IsProxy()); |
24343 CHECK(!target->IsProxy()); | 24349 CHECK(!target->IsProxy()); |
24344 CHECK(proxy->IsRevoked()); | 24350 CHECK(proxy->IsRevoked()); |
24345 CHECK(proxy->GetTarget()->SameValue(target)); | 24351 CHECK(proxy->GetTarget()->SameValue(target)); |
24346 CHECK(proxy->GetHandler()->IsNull()); | 24352 CHECK(proxy->GetHandler()->IsNull()); |
24347 } | 24353 } |
OLD | NEW |