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 8710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 v8::Handle<Value> value; | 8730 v8::Handle<Value> value; |
8731 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: 43})"); | 8731 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})"); |
8732 value = CompileRun("other.accessible_prop == 43"); | 8732 value = CompileRun("other.accessible_prop == 42"); |
8733 CHECK(value->IsTrue()); | 8733 CHECK(value->IsTrue()); |
8734 CHECK_EQ(43, g_echo_value); // Make sure we didn't overwrite the setter. | |
8735 } | 8734 } |
8736 | 8735 |
8737 | 8736 |
8738 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name, | 8737 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name, |
8739 v8::AccessType type, Local<Value> data) { | 8738 v8::AccessType type, Local<Value> data) { |
8740 i::PrintF("Access blocked.\n"); | 8739 i::PrintF("Access blocked.\n"); |
8741 return false; | 8740 return false; |
8742 } | 8741 } |
8743 | 8742 |
8744 | 8743 |
(...skipping 13196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21941 LocalContext env; | 21940 LocalContext env; |
21942 | 21941 |
21943 env->Global()->Set(v8_str("keys"), v8::Array::GetKeysIterator(isolate)); | 21942 env->Global()->Set(v8_str("keys"), v8::Array::GetKeysIterator(isolate)); |
21944 env->Global()->Set(v8_str("values"), v8::Array::GetValuesIterator(isolate)); | 21943 env->Global()->Set(v8_str("values"), v8::Array::GetValuesIterator(isolate)); |
21945 env->Global()->Set(v8_str("entries"), v8::Array::GetEntriesIterator(isolate)); | 21944 env->Global()->Set(v8_str("entries"), v8::Array::GetEntriesIterator(isolate)); |
21946 | 21945 |
21947 ExpectString("typeof keys", "function"); | 21946 ExpectString("typeof keys", "function"); |
21948 ExpectString("typeof values", "function"); | 21947 ExpectString("typeof values", "function"); |
21949 ExpectString("typeof entries", "function"); | 21948 ExpectString("typeof entries", "function"); |
21950 } | 21949 } |
OLD | NEW |