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-reflect --harmony-destructuring-bind --harmony-rest-paramete
rs | 5 // Flags: --harmony-reflect --harmony-destructuring-bind |
6 | 6 |
7 | 7 |
8 (function TestClass() { | 8 (function TestClass() { |
9 'use strict'; | 9 'use strict'; |
10 | 10 |
11 var calls = 0; | 11 var calls = 0; |
12 class Base { | 12 class Base { |
13 constructor(_) { | 13 constructor(_) { |
14 assertEquals(Base, new.target); | 14 assertEquals(Base, new.target); |
15 calls++; | 15 calls++; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 (function TestEarlyErrors() { | 405 (function TestEarlyErrors() { |
406 assertThrows(function() { Function("new.target = 42"); }, ReferenceError); | 406 assertThrows(function() { Function("new.target = 42"); }, ReferenceError); |
407 assertThrows(function() { Function("var foo = 1; new.target = foo = 42"); }, R
eferenceError); | 407 assertThrows(function() { Function("var foo = 1; new.target = foo = 42"); }, R
eferenceError); |
408 assertThrows(function() { Function("var foo = 1; foo = new.target = 42"); }, R
eferenceError); | 408 assertThrows(function() { Function("var foo = 1; foo = new.target = 42"); }, R
eferenceError); |
409 assertThrows(function() { Function("new.target--"); }, ReferenceError); | 409 assertThrows(function() { Function("new.target--"); }, ReferenceError); |
410 assertThrows(function() { Function("--new.target"); }, ReferenceError); | 410 assertThrows(function() { Function("--new.target"); }, ReferenceError); |
411 assertThrows(function() { Function("(new.target)++"); }, ReferenceError); | 411 assertThrows(function() { Function("(new.target)++"); }, ReferenceError); |
412 assertThrows(function() { Function("++(new.target)"); }, ReferenceError); | 412 assertThrows(function() { Function("++(new.target)"); }, ReferenceError); |
413 assertThrows(function() { Function("for (new.target of {});"); }, SyntaxError)
; | 413 assertThrows(function() { Function("for (new.target of {});"); }, SyntaxError)
; |
414 })(); | 414 })(); |
OLD | NEW |