| // Copyright 2014 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Flags: --allow-natives-syntax |
| class Derived extends Base {} |
| assertTrue(%HaveSameMap(d1, d2)); |
| (function TestProtoModificationArray() { |
| assertFalse(Array.isArray(this)); |
| class Derived extends Array {} |
| assertSame(Derived.__proto__, Array); |
| assertTrue(Array.isArray(d1)); |
| assertFalse(Array.isArray(d2)); |
| assertFalse(%HaveSameMap(d1, d2)); |
| (function TestProtoModification() { |
| assertTrue(exn instanceof TypeError); |
| class Derived extends Uint8Array { |
| constructor() { super(10); } |
| assertSame(Derived.__proto__, Uint8Array); |
| assertSame(10, d1.byteLength); |
| assertThrows(function() { d2.byteLength; }, TypeError); |
| assertFalse(%HaveSameMap(d1, d2)); |