mirror of
https://github.com/tc39/test262.git
synced 2025-12-13 16:53:46 +01:00
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
desc: Static Methods can be named constructor
|
|
info: |
|
|
Class Definitions / Static Semantics: Early Errors
|
|
|
|
ClassElement : MethodDefinition
|
|
It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
|
|
It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true.
|
|
ClassElement : static MethodDefinition
|
|
It is a Syntax Error if HasDirectSuper of MethodDefinition is true.
|
|
It is a Syntax Error if PropName of MethodDefinition is "prototype".
|
|
template: syntax/valid
|
|
features: [async-functions]
|
|
---*/
|
|
|
|
//- elements
|
|
static async constructor() {}
|
|
constructor() {} // stacks with a valid constructor
|
|
//- teardown
|
|
assert(C.hasOwnProperty('constructor'));
|
|
assert(C.prototype.hasOwnProperty('constructor'));
|
|
assert.notSameValue(C.prototype.constructor, C.constructor);
|