| 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 16117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16128 CHECK(result5->Equals( | 16128 CHECK(result5->Equals( |
| 16129 object_with_hidden->GetPrototype()->ToObject()->GetPrototype())); | 16129 object_with_hidden->GetPrototype()->ToObject()->GetPrototype())); |
| 16130 | 16130 |
| 16131 Local<Value> result6 = CompileRun("Object.getPrototypeOf(phidden)"); | 16131 Local<Value> result6 = CompileRun("Object.getPrototypeOf(phidden)"); |
| 16132 CHECK(result6->Equals(Undefined())); | 16132 CHECK(result6->Equals(Undefined())); |
| 16133 | 16133 |
| 16134 context.Dispose(); | 16134 context.Dispose(); |
| 16135 } | 16135 } |
| 16136 | 16136 |
| 16137 | 16137 |
| 16138 THREADED_TEST(Regress125988) { |
| 16139 v8::HandleScope scope; |
| 16140 Handle<FunctionTemplate> intercept = FunctionTemplate::New(); |
| 16141 AddInterceptor(intercept, EmptyInterceptorGetter, EmptyInterceptorSetter); |
| 16142 LocalContext env; |
| 16143 env->Global()->Set(v8_str("Intercept"), intercept->GetFunction()); |
| 16144 CompileRun("var a = new Object();" |
| 16145 "var b = new Intercept();" |
| 16146 "var c = new Object();" |
| 16147 "c.__proto__ = b;" |
| 16148 "b.__proto__ = a;" |
| 16149 "a.x = 23;" |
| 16150 "for (var i = 0; i < 3; i++) c.x;"); |
| 16151 ExpectBoolean("c.hasOwnProperty('x')", false); |
| 16152 ExpectInt32("c.x", 23); |
| 16153 CompileRun("a.y = 42;" |
| 16154 "for (var i = 0; i < 3; i++) c.x;"); |
| 16155 ExpectBoolean("c.hasOwnProperty('x')", false); |
| 16156 ExpectInt32("c.x", 23); |
| 16157 ExpectBoolean("c.hasOwnProperty('y')", false); |
| 16158 ExpectInt32("c.y", 42); |
| 16159 } |
| 16160 |
| 16161 |
| 16138 static void TestReceiver(Local<Value> expected_result, | 16162 static void TestReceiver(Local<Value> expected_result, |
| 16139 Local<Value> expected_receiver, | 16163 Local<Value> expected_receiver, |
| 16140 const char* code) { | 16164 const char* code) { |
| 16141 Local<Value> result = CompileRun(code); | 16165 Local<Value> result = CompileRun(code); |
| 16142 CHECK(result->IsObject()); | 16166 CHECK(result->IsObject()); |
| 16143 CHECK(expected_receiver->Equals(result->ToObject()->Get(1))); | 16167 CHECK(expected_receiver->Equals(result->ToObject()->Get(1))); |
| 16144 CHECK(expected_result->Equals(result->ToObject()->Get(0))); | 16168 CHECK(expected_result->Equals(result->ToObject()->Get(0))); |
| 16145 } | 16169 } |
| 16146 | 16170 |
| 16147 | 16171 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16394 | 16418 |
| 16395 TEST(SecondaryStubCache) { | 16419 TEST(SecondaryStubCache) { |
| 16396 StubCacheHelper(true); | 16420 StubCacheHelper(true); |
| 16397 } | 16421 } |
| 16398 | 16422 |
| 16399 | 16423 |
| 16400 TEST(PrimaryStubCache) { | 16424 TEST(PrimaryStubCache) { |
| 16401 StubCacheHelper(false); | 16425 StubCacheHelper(false); |
| 16402 } | 16426 } |
| 16403 | 16427 |
| OLD | NEW |