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

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

Issue 1403633007: Remove stale references to --harmony-arrays flag in mjsunit tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « test/mjsunit/es6/array-copywithin.js ('k') | test/mjsunit/es6/array-find.js » ('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 4
5 // Flags: --harmony-arrays
6
7 assertEquals(1, Array.prototype.fill.length); 5 assertEquals(1, Array.prototype.fill.length);
8 6
9 assertArrayEquals([].fill(8), []); 7 assertArrayEquals([].fill(8), []);
10 assertArrayEquals([0, 0, 0, 0, 0].fill(), [undefined, undefined, undefined, unde fined, undefined]); 8 assertArrayEquals([0, 0, 0, 0, 0].fill(), [undefined, undefined, undefined, unde fined, undefined]);
11 assertArrayEquals([0, 0, 0, 0, 0].fill(8), [8, 8, 8, 8, 8]); 9 assertArrayEquals([0, 0, 0, 0, 0].fill(8), [8, 8, 8, 8, 8]);
12 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1), [0, 8, 8, 8, 8]); 10 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1), [0, 8, 8, 8, 8]);
13 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 10), [0, 0, 0, 0, 0]); 11 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 10), [0, 0, 0, 0, 0]);
14 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -5), [8, 8, 8, 8, 8]); 12 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -5), [8, 8, 8, 8, 8]);
15 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, 4), [0, 8, 8, 8, 0]); 13 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, 4), [0, 8, 8, 8, 0]);
16 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, -1), [0, 8, 8, 8, 0]); 14 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, -1), [0, 8, 8, 8, 0]);
17 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, 42), [0, 8, 8, 8, 8]); 15 assertArrayEquals([0, 0, 0, 0, 0].fill(8, 1, 42), [0, 8, 8, 8, 8]);
18 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -3, 42), [0, 0, 8, 8, 8]); 16 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -3, 42), [0, 0, 8, 8, 8]);
19 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -3, 4), [0, 0, 8, 8, 0]); 17 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -3, 4), [0, 0, 8, 8, 0]);
20 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -2, -1), [0, 0, 0, 8, 0]); 18 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -2, -1), [0, 0, 0, 8, 0]);
21 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -1, -3), [0, 0, 0, 0, 0]); 19 assertArrayEquals([0, 0, 0, 0, 0].fill(8, -1, -3), [0, 0, 0, 0, 0]);
22 assertArrayEquals([0, 0, 0, 0, 0].fill(8, undefined, 4), [8, 8, 8, 8, 0]); 20 assertArrayEquals([0, 0, 0, 0, 0].fill(8, undefined, 4), [8, 8, 8, 8, 0]);
23 assertArrayEquals([ , , , , 0].fill(8, 1, 3), [, 8, 8, , 0]); 21 assertArrayEquals([ , , , , 0].fill(8, 1, 3), [, 8, 8, , 0]);
24 22
25 // If the range is empty, the array is not actually modified and 23 // If the range is empty, the array is not actually modified and
26 // should not throw, even when applied to a frozen object. 24 // should not throw, even when applied to a frozen object.
27 assertArrayEquals(Object.freeze([1, 2, 3]).fill(0, 0, 0), [1, 2, 3]); 25 assertArrayEquals(Object.freeze([1, 2, 3]).fill(0, 0, 0), [1, 2, 3]);
28 26
29 // Test exceptions 27 // Test exceptions
30 assertThrows('Object.freeze([0]).fill()', TypeError); 28 assertThrows('Object.freeze([0]).fill()', TypeError);
31 assertThrows('Array.prototype.fill.call(null)', TypeError); 29 assertThrows('Array.prototype.fill.call(null)', TypeError);
32 assertThrows('Array.prototype.fill.call(undefined)', TypeError); 30 assertThrows('Array.prototype.fill.call(undefined)', TypeError);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/array-copywithin.js ('k') | test/mjsunit/es6/array-find.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698