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 8709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8720 | 8720 |
8721 CompileRun("Object.seal(other)"); | 8721 CompileRun("Object.seal(other)"); |
8722 ExpectTrue("Object.isExtensible(other)"); | 8722 ExpectTrue("Object.isExtensible(other)"); |
8723 | 8723 |
8724 // Regression test for issue 1250. | 8724 // Regression test for issue 1250. |
8725 // Make sure that we can set the accessible accessors value using normal | 8725 // Make sure that we can set the accessible accessors value using normal |
8726 // assignment. | 8726 // assignment. |
8727 CompileRun("other.accessible_prop = 42"); | 8727 CompileRun("other.accessible_prop = 42"); |
8728 CHECK_EQ(42, g_echo_value); | 8728 CHECK_EQ(42, g_echo_value); |
8729 | 8729 |
8730 // [[DefineOwnProperty]] always throws for access-checked objects. | 8730 v8::Handle<Value> value; |
8731 CHECK( | 8731 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})"); |
8732 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: 43})") | 8732 value = CompileRun("other.accessible_prop == 42"); |
8733 .IsEmpty()); | 8733 CHECK(value->IsTrue()); |
8734 CHECK(CompileRun("other.accessible_prop == 42")->IsTrue()); | |
8735 CHECK_EQ(42, g_echo_value); // Make sure we didn't call the setter. | |
8736 } | 8734 } |
8737 | 8735 |
8738 | 8736 |
8739 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name, | 8737 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name, |
8740 v8::AccessType type, Local<Value> data) { | 8738 v8::AccessType type, Local<Value> data) { |
8741 i::PrintF("Access blocked.\n"); | 8739 i::PrintF("Access blocked.\n"); |
8742 return false; | 8740 return false; |
8743 } | 8741 } |
8744 | 8742 |
8745 | 8743 |
(...skipping 13203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21949 env2->Global()->Set(v8_str("obj2"), object2); | 21947 env2->Global()->Set(v8_str("obj2"), object2); |
21950 ExpectString("typeof obj2.values", "function"); | 21948 ExpectString("typeof obj2.values", "function"); |
21951 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); | 21949 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); |
21952 | 21950 |
21953 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); | 21951 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); |
21954 auto fn2 = v8::Utils::OpenHandle(*values2); | 21952 auto fn2 = v8::Utils::OpenHandle(*values2); |
21955 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); | 21953 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); |
21956 CHECK_EQ(fn2->GetCreationContext(), *ctx2); | 21954 CHECK_EQ(fn2->GetCreationContext(), *ctx2); |
21957 } | 21955 } |
21958 } | 21956 } |
OLD | NEW |