blob: 6f7d1c3491b8b39c8e232f7f96bfecb58c94f693 [file] [log] [blame]
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-static-ctor-async-gen-meth-valid.case
// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template
/*---
description: Static Async Generator Methods can be named constructor (class declaration)
esid: prod-ClassElement
features: [async-iteration, class]
flags: [generated]
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".
---*/
class C {
static async * constructor() {}
constructor() {} // stacks with a valid constructor
}
assert(C.hasOwnProperty('constructor'));
assert(C.prototype.hasOwnProperty('constructor'));
assert.notSameValue(C.prototype.constructor, C.constructor);