OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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-species | |
6 | |
7 'use strict'; | 5 'use strict'; |
8 | 6 |
9 var typedArray = new Int8Array(1); | 7 var typedArray = new Int8Array(1); |
10 var saved; | 8 var saved; |
11 var called; | 9 var called; |
12 class TypedArraySubclass extends Int8Array { | 10 class TypedArraySubclass extends Int8Array { |
13 constructor(x) { | 11 constructor(x) { |
14 super(x); | 12 super(x); |
15 called = true; | 13 called = true; |
16 saved = x; | 14 saved = x; |
17 } | 15 } |
18 } | 16 } |
19 typedArray.constructor = TypedArraySubclass | 17 typedArray.constructor = TypedArraySubclass |
20 typedArray.map(function(){}); | 18 typedArray.map(function(){}); |
21 | 19 |
22 assertTrue(called); | 20 assertTrue(called); |
23 assertEquals(saved, 1); | 21 assertEquals(saved, 1); |
OLD | NEW |