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