33eb473037
The current error message assumes all classes are named, which results in a double space and awkward wording when calling an anonymous class constructor. Bug: v8:10025 Change-Id: Ibe913152c0816cbbaaa0c7a88db4e415762ae9bb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1947336 Commit-Queue: Shu-yu Guo <syg@chromium.org> Auto-Submit: Shu-yu Guo <syg@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#65354}
17 lines
903 B
Plaintext
17 lines
903 B
Plaintext
Tests for calling the constructors of ES6 classes
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
PASS new A did not throw exception.
|
|
PASS A() threw exception TypeError: Class constructor A cannot be invoked without 'new'.
|
|
PASS new B did not throw exception.
|
|
PASS B() threw exception TypeError: Class constructor B cannot be invoked without 'new'.
|
|
PASS new (class { constructor() {} })() did not throw exception.
|
|
PASS (class { constructor() {} })() threw exception TypeError: Class constructors cannot be invoked without 'new'.
|
|
PASS new (class extends null { constructor() { super() } })() threw exception TypeError: Super constructor null of anonymous class is not a constructor.
|
|
PASS (class extends null { constructor() { super() } })() threw exception TypeError: Class constructors cannot be invoked without 'new'.
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|