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

Side by Side Diff: test/mjsunit/es6/array-concat.js

Issue 2131383002: [builtins] take slow path in IsConcatSpreadable if proxy in prototype (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 5 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/objects.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 (function testArrayConcatArity() { 4 (function testArrayConcatArity() {
5 "use strict"; 5 "use strict";
6 assertEquals(1, Array.prototype.concat.length); 6 assertEquals(1, Array.prototype.concat.length);
7 })(); 7 })();
8 8
9 9
10 (function testArrayConcatNoPrototype() { 10 (function testArrayConcatNoPrototype() {
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 if (key === "length") return Symbol(); 865 if (key === "length") return Symbol();
866 if (key === "2") return "baz"; 866 if (key === "2") return "baz";
867 if (key === "3") return "bar"; 867 if (key === "3") return "bar";
868 }; 868 };
869 var target = []; 869 var target = [];
870 var obj = new Proxy(target, {get: getTrap, has: () => true}); 870 var obj = new Proxy(target, {get: getTrap, has: () => true});
871 871
872 assertThrows(() => [].concat(obj), TypeError); 872 assertThrows(() => [].concat(obj), TypeError);
873 assertThrows(() => Array.prototype.concat.apply(obj), TypeError); 873 assertThrows(() => Array.prototype.concat.apply(obj), TypeError);
874 })(); 874 })();
875
876 (function testConcatRevokedProxy() {
877 "use strict";
878 var target = [];
879 var handler = {
880 get(_, name) {
881 if (name === Symbol.isConcatSpreadable) {
882 p.revoke();
883 }
884 return target[name];
885 }
886 }
887
888 p = Proxy.revocable(target, handler);
889 target = {};
890 target.__proto__ = p.proxy;
891 assertThrows(function() { [].concat({ __proto__: p.proxy }); }, TypeError);
892
893 target = [];
894 var p = Proxy.revocable(target, handler);
895 assertThrows(function() { [].concat(p.proxy); }, TypeError);
896 })();
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698