OLD | NEW |
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 | 4 |
5 // Flags: --harmony-concat-spreadable --harmony-proxies --harmony-reflect | 5 // Flags: --harmony-proxies --harmony-reflect |
6 | 6 |
7 (function testArrayConcatArity() { | 7 (function testArrayConcatArity() { |
8 "use strict"; | 8 "use strict"; |
9 assertEquals(1, Array.prototype.concat.length); | 9 assertEquals(1, Array.prototype.concat.length); |
10 })(); | 10 })(); |
11 | 11 |
12 | 12 |
13 (function testArrayConcatNoPrototype() { | 13 (function testArrayConcatNoPrototype() { |
14 "use strict"; | 14 "use strict"; |
15 assertEquals(void 0, Array.prototype.concat.prototype); | 15 assertEquals(void 0, Array.prototype.concat.prototype); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 })(); |
OLD | NEW |