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

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

Issue 1421123002: Revert of Reland "Use C++ implementation of Object.definePropert{y,ies}" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 8709 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 13170 matching lines...) Expand 10 before | Expand all | Expand 10 after
21916 ExpectTrue("object[Symbol.isConcatSpreadable]"); 21914 ExpectTrue("object[Symbol.isConcatSpreadable]");
21917 21915
21918 // If access check fails, the value of @@isConcatSpreadable is ignored 21916 // If access check fails, the value of @@isConcatSpreadable is ignored
21919 allowed_access = false; 21917 allowed_access = false;
21920 CompileRun("var result = [].concat(object)"); 21918 CompileRun("var result = [].concat(object)");
21921 ExpectTrue("Array.isArray(result)"); 21919 ExpectTrue("Array.isArray(result)");
21922 ExpectTrue("result[0] === object"); 21920 ExpectTrue("result[0] === object");
21923 ExpectTrue("result.length === 1"); 21921 ExpectTrue("result.length === 1");
21924 ExpectTrue("object[Symbol.isConcatSpreadable] === undefined"); 21922 ExpectTrue("object[Symbol.isConcatSpreadable] === undefined");
21925 } 21923 }
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