Chiffon
Chiffon copied to clipboard
Accepts invalid Class syntax
This one:
- It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true.
class A {
foo() {
super() // Invalid 'super()'.
}
}
http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions-static-semantics-early-errors
And also this one
class A {
static foo() {
super() // Invalid 'super()'.
}
static prototype() { // Invalid method.
}
}
For this bugs
- It is a Syntax Error if FormalParameters Contains SuperProperty is true.
- It is a Syntax Error if FunctionBody Contains SuperProperty is true.
- It is a Syntax Error if FormalParameters Contains SuperCall is true.
- It is a Syntax Error if FunctionBody Contains SuperCall is true.
//-
function foo() {
super() // Invalid `super`.
super.foo() // Invalid `super`.
}
var foo = function() {
super() // Invalid `super`.
super.foo() // Invalid `super`.
}
function wrap() {
function foo(a = super(), b = super.foo()) { // Invalid 'super'.
}
}
super is not support 100% ECMA-262 compatible yet. Thanks for your test!