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

Side by Side Diff: test/mjsunit/harmony/array-species-parent-constructor.js

Issue 2096933002: Remove all harmony runtime flags which shipped in M51 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments 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
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --harmony-species --allow-natives-syntax
6
7 // Overwriting Array.prototype.constructor updates the protector
8
9 let x = [];
10
11 assertEquals(Array, x.map(()=>{}).constructor);
12 assertEquals(Array, x.filter(()=>{}).constructor);
13 assertEquals(Array, x.slice().constructor);
14 assertEquals(Array, x.splice().constructor);
15 assertEquals(Array, x.concat([1]).constructor);
16 assertEquals(1, x.concat([1])[0]);
17
18 class MyArray extends Array { }
19
20 Array.prototype.constructor = MyArray;
21 assertFalse(%SpeciesProtector());
22
23 assertEquals(MyArray, x.map(()=>{}).constructor);
24 assertEquals(MyArray, x.filter(()=>{}).constructor);
25 assertEquals(MyArray, x.slice().constructor);
26 assertEquals(MyArray, x.splice().constructor);
27 assertEquals(MyArray, x.concat([1]).constructor);
28 assertEquals(1, x.concat([1])[0]);
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/array-species-modified.js ('k') | test/mjsunit/harmony/array-species-proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698