Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(846)

Side by Side Diff: test/cctest/test-api.cc

Issue 1409613004: Use C++ implementation of Object.definePropert{y,ies} (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix GetKeys regression after df8970a8c Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/property-descriptor.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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: -1})"); 8731 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: 43})");
8732 value = CompileRun("other.accessible_prop == 42"); 8732 value = CompileRun("other.accessible_prop == 43");
8733 CHECK(value->IsTrue()); 8733 CHECK(value->IsTrue());
8734 CHECK_EQ(43, g_echo_value); // Make sure we didn't overwrite the setter.
8734 } 8735 }
8735 8736
8736 8737
8737 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name, 8738 static bool AccessAlwaysBlocked(Local<v8::Object> global, Local<Value> name,
8738 v8::AccessType type, Local<Value> data) { 8739 v8::AccessType type, Local<Value> data) {
8739 i::PrintF("Access blocked.\n"); 8740 i::PrintF("Access blocked.\n");
8740 return false; 8741 return false;
8741 } 8742 }
8742 8743
8743 8744
(...skipping 13196 matching lines...) Expand 10 before | Expand all | Expand 10 after
21940 LocalContext env; 21941 LocalContext env;
21941 21942
21942 env->Global()->Set(v8_str("keys"), v8::Array::GetKeysIterator(isolate)); 21943 env->Global()->Set(v8_str("keys"), v8::Array::GetKeysIterator(isolate));
21943 env->Global()->Set(v8_str("values"), v8::Array::GetValuesIterator(isolate)); 21944 env->Global()->Set(v8_str("values"), v8::Array::GetValuesIterator(isolate));
21944 env->Global()->Set(v8_str("entries"), v8::Array::GetEntriesIterator(isolate)); 21945 env->Global()->Set(v8_str("entries"), v8::Array::GetEntriesIterator(isolate));
21945 21946
21946 ExpectString("typeof keys", "function"); 21947 ExpectString("typeof keys", "function");
21947 ExpectString("typeof values", "function"); 21948 ExpectString("typeof values", "function");
21948 ExpectString("typeof entries", "function"); 21949 ExpectString("typeof entries", "function");
21949 } 21950 }
OLDNEW
« no previous file with comments | « src/property-descriptor.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698