| 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 23429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23440 } | 23440 } |
| 23441 | 23441 |
| 23442 | 23442 |
| 23443 TEST(StrongObjectDelete) { | 23443 TEST(StrongObjectDelete) { |
| 23444 i::FLAG_strong_mode = true; | 23444 i::FLAG_strong_mode = true; |
| 23445 LocalContext env; | 23445 LocalContext env; |
| 23446 v8::Isolate* isolate = env->GetIsolate(); | 23446 v8::Isolate* isolate = env->GetIsolate(); |
| 23447 v8::HandleScope scope(isolate); | 23447 v8::HandleScope scope(isolate); |
| 23448 Local<Object> obj; | 23448 Local<Object> obj; |
| 23449 { | 23449 { |
| 23450 v8::TryCatch try_catch; | 23450 v8::TryCatch try_catch(isolate); |
| 23451 obj = Local<Object>::Cast(CompileRun( | 23451 obj = Local<Object>::Cast(CompileRun( |
| 23452 "'use strong';" | 23452 "'use strong';" |
| 23453 "({});")); | 23453 "({});")); |
| 23454 CHECK(!try_catch.HasCaught()); | 23454 CHECK(!try_catch.HasCaught()); |
| 23455 } | 23455 } |
| 23456 obj->ForceSet(v8_str("foo"), v8_num(1), v8::None); | 23456 obj->ForceSet(v8_str("foo"), v8_num(1), v8::None); |
| 23457 obj->ForceSet(v8_str("2"), v8_num(1), v8::None); | 23457 obj->ForceSet(v8_str("2"), v8_num(1), v8::None); |
| 23458 CHECK(obj->HasOwnProperty(v8_str("foo"))); | 23458 CHECK(obj->HasOwnProperty(v8_str("foo"))); |
| 23459 CHECK(obj->HasOwnProperty(v8_str("2"))); | 23459 CHECK(obj->HasOwnProperty(v8_str("2"))); |
| 23460 CHECK(!obj->Delete(v8_str("foo"))); | 23460 CHECK(!obj->Delete(v8_str("foo"))); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23884 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); | 23884 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); |
| 23885 ExpectString("typeof obj2.values", "function"); | 23885 ExpectString("typeof obj2.values", "function"); |
| 23886 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); | 23886 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); |
| 23887 | 23887 |
| 23888 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); | 23888 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); |
| 23889 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); | 23889 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); |
| 23890 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); | 23890 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); |
| 23891 CHECK_EQ(fn2->GetCreationContext(), *ctx2); | 23891 CHECK_EQ(fn2->GetCreationContext(), *ctx2); |
| 23892 } | 23892 } |
| 23893 } | 23893 } |
| OLD | NEW |