| 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 8671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8682 CHECK(value.IsEmpty()); | 8682 CHECK(value.IsEmpty()); |
| 8683 | 8683 |
| 8684 context1->Exit(); | 8684 context1->Exit(); |
| 8685 context0->Exit(); | 8685 context0->Exit(); |
| 8686 } | 8686 } |
| 8687 | 8687 |
| 8688 | 8688 |
| 8689 TEST(SuperAccessControl) { | 8689 TEST(SuperAccessControl) { |
| 8690 i::FLAG_allow_natives_syntax = true; | 8690 i::FLAG_allow_natives_syntax = true; |
| 8691 i::FLAG_harmony_classes = true; | 8691 i::FLAG_harmony_classes = true; |
| 8692 i::FLAG_harmony_object_literals = true; | |
| 8693 v8::Isolate* isolate = CcTest::isolate(); | 8692 v8::Isolate* isolate = CcTest::isolate(); |
| 8694 v8::HandleScope handle_scope(isolate); | 8693 v8::HandleScope handle_scope(isolate); |
| 8695 v8::Handle<v8::ObjectTemplate> obj_template = | 8694 v8::Handle<v8::ObjectTemplate> obj_template = |
| 8696 v8::ObjectTemplate::New(isolate); | 8695 v8::ObjectTemplate::New(isolate); |
| 8697 obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); | 8696 obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); |
| 8698 LocalContext env; | 8697 LocalContext env; |
| 8699 env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance()); | 8698 env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance()); |
| 8700 | 8699 |
| 8701 { | 8700 { |
| 8702 v8::TryCatch try_catch(isolate); | 8701 v8::TryCatch try_catch(isolate); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8737 "}.m;" | 8736 "}.m;" |
| 8738 "var m = %ToMethod(f, prohibited);" | 8737 "var m = %ToMethod(f, prohibited);" |
| 8739 "m();"); | 8738 "m();"); |
| 8740 CHECK(try_catch.HasCaught()); | 8739 CHECK(try_catch.HasCaught()); |
| 8741 } | 8740 } |
| 8742 } | 8741 } |
| 8743 | 8742 |
| 8744 | 8743 |
| 8745 TEST(Regress470113) { | 8744 TEST(Regress470113) { |
| 8746 i::FLAG_harmony_classes = true; | 8745 i::FLAG_harmony_classes = true; |
| 8747 i::FLAG_harmony_object_literals = true; | |
| 8748 v8::Isolate* isolate = CcTest::isolate(); | 8746 v8::Isolate* isolate = CcTest::isolate(); |
| 8749 v8::HandleScope handle_scope(isolate); | 8747 v8::HandleScope handle_scope(isolate); |
| 8750 v8::Handle<v8::ObjectTemplate> obj_template = | 8748 v8::Handle<v8::ObjectTemplate> obj_template = |
| 8751 v8::ObjectTemplate::New(isolate); | 8749 v8::ObjectTemplate::New(isolate); |
| 8752 obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); | 8750 obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL); |
| 8753 LocalContext env; | 8751 LocalContext env; |
| 8754 env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance()); | 8752 env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance()); |
| 8755 | 8753 |
| 8756 { | 8754 { |
| 8757 v8::TryCatch try_catch(isolate); | 8755 v8::TryCatch try_catch(isolate); |
| (...skipping 12902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21660 CHECK(set->Has(env.local(), set).FromJust()); | 21658 CHECK(set->Has(env.local(), set).FromJust()); |
| 21661 | 21659 |
| 21662 CHECK(set->Delete(env.local(), set).FromJust()); | 21660 CHECK(set->Delete(env.local(), set).FromJust()); |
| 21663 CHECK_EQ(2U, set->Size()); | 21661 CHECK_EQ(2U, set->Size()); |
| 21664 CHECK(!set->Has(env.local(), set).FromJust()); | 21662 CHECK(!set->Has(env.local(), set).FromJust()); |
| 21665 CHECK(!set->Delete(env.local(), set).FromJust()); | 21663 CHECK(!set->Delete(env.local(), set).FromJust()); |
| 21666 | 21664 |
| 21667 set->Clear(); | 21665 set->Clear(); |
| 21668 CHECK_EQ(0U, set->Size()); | 21666 CHECK_EQ(0U, set->Size()); |
| 21669 } | 21667 } |
| OLD | NEW |