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

Side by Side Diff: test/mjsunit/es6/legacy-subclassing.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
« no previous file with comments | « test/mjsunit/es6/iterator-close.js ('k') | test/mjsunit/es6/no-unicode-regexp-flag.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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: --noharmony-species
6
7 // Before Symbol.species was added, ArrayBuffer subclasses constructed
8 // ArrayBuffers, and Array subclasses constructed Arrays, but TypedArray and
9 // Promise subclasses constructed an instance of the subclass.
10
11 'use strict';
12
13 assertEquals(undefined, Symbol.species);
14
15 class MyArray extends Array { }
16 let myArray = new MyArray();
17 assertEquals(MyArray, myArray.constructor);
18 assertEquals(Array, myArray.map(x => x + 1).constructor);
19 assertEquals(Array, myArray.concat().constructor);
20
21 class MyUint8Array extends Uint8Array { }
22 Object.defineProperty(MyUint8Array.prototype, "BYTES_PER_ELEMENT", {value: 1});
23 let myTypedArray = new MyUint8Array(3);
24 assertEquals(MyUint8Array, myTypedArray.constructor);
25 assertEquals(MyUint8Array, myTypedArray.map(x => x + 1).constructor);
26
27 class MyArrayBuffer extends ArrayBuffer { }
28 let myBuffer = new MyArrayBuffer(0);
29 assertEquals(MyArrayBuffer, myBuffer.constructor);
30 assertEquals(ArrayBuffer, myBuffer.slice().constructor);
31
32 class MyPromise extends Promise { }
33 let myPromise = new MyPromise(() => {});
34 assertEquals(MyPromise, myPromise.constructor);
35 assertEquals(MyPromise, myPromise.then().constructor);
36
37 // However, subarray instantiates members of the parent class
38 assertEquals(Uint8Array, myTypedArray.subarray(1).constructor);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/iterator-close.js ('k') | test/mjsunit/es6/no-unicode-regexp-flag.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698