mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 05:33:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// This file was procedurally generated from the following sources:
 | 
						|
// - src/class-elements/grammar-static-ctor-async-meth-valid.case
 | 
						|
// - src/class-elements/syntax/valid/cls-expr-elements-valid-syntax.template
 | 
						|
/*---
 | 
						|
description: Static Methods can be named constructor (class expression)
 | 
						|
esid: prod-ClassElement
 | 
						|
features: [async-functions, 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".
 | 
						|
 | 
						|
---*/
 | 
						|
 | 
						|
 | 
						|
var C = class {
 | 
						|
  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);
 |