| OLD | NEW |
| 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-classes | 5 // Flags: --harmony-classes |
| 6 | 6 |
| 7 'use strict'; | 7 'use strict'; |
| 8 (function TestArgumentsAccess() { | 8 (function TestArgumentsAccess() { |
| 9 class Base { | 9 class Base { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 assertEquals(1, fCalled); | 157 assertEquals(1, fCalled); |
| 158 assertEquals(1, baseCalled); | 158 assertEquals(1, baseCalled); |
| 159 assertSame(obj, this); | 159 assertSame(obj, this); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 new Subclass1(); | 163 new Subclass1(); |
| 164 }()); | 164 }()); |
| 165 | 165 |
| 166 | 166 |
| 167 (function TestSuperInBaseConstructors() { | |
| 168 class Base { | |
| 169 constructor() { | |
| 170 let exn = null; | |
| 171 try { | |
| 172 super(); | |
| 173 } catch (e) { | |
| 174 exn = e; | |
| 175 } | |
| 176 assertTrue(exn instanceof ReferenceError); | |
| 177 } | |
| 178 } | |
| 179 | |
| 180 new Base(); | |
| 181 }()); | |
| 182 | |
| 183 | |
| 184 (function TestPrototypeWiring() { | 167 (function TestPrototypeWiring() { |
| 185 class Base { | 168 class Base { |
| 186 constructor(x) { | 169 constructor(x) { |
| 187 this.foobar = x; | 170 this.foobar = x; |
| 188 } | 171 } |
| 189 } | 172 } |
| 190 | 173 |
| 191 class Subclass extends Base { | 174 class Subclass extends Base { |
| 192 constructor(x) { | 175 constructor(x) { |
| 193 super(x); | 176 super(x); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 var eua = new ExtendedUint8Array(10); | 330 var eua = new ExtendedUint8Array(10); |
| 348 assertEquals(10, eua.length); | 331 assertEquals(10, eua.length); |
| 349 assertEquals(10, eua.byteLength); | 332 assertEquals(10, eua.byteLength); |
| 350 eua[0] = 0xFF; | 333 eua[0] = 0xFF; |
| 351 eua[1] = 0xFFA; | 334 eua[1] = 0xFFA; |
| 352 assertEquals(0xFF, eua[0]); | 335 assertEquals(0xFF, eua[0]); |
| 353 assertEquals(0xFA, eua[1]); | 336 assertEquals(0xFA, eua[1]); |
| 354 assertSame(ExtendedUint8Array.prototype, eua.__proto__); | 337 assertSame(ExtendedUint8Array.prototype, eua.__proto__); |
| 355 assertEquals("[object Uint8Array]", Object.prototype.toString.call(eua)); | 338 assertEquals("[object Uint8Array]", Object.prototype.toString.call(eua)); |
| 356 }()); | 339 }()); |
| OLD | NEW |