esprima icon indicating copy to clipboard operation
esprima copied to clipboard

super() in non derived class

Open peeyush18 opened this issue 6 years ago • 0 comments

super() in non derived class constructors should throw a syntax error

Steps to reproduce

esprima.parse('class A{
 constructor(){
  super(); 
 }
}')

Expected output

throw an syntax error. in firefox

 SyntaxError: super() is only valid in derived class constructors

in chrome

Uncaught SyntaxError: 'super' keyword unexpected here

Actual output

Relevant references

peeyush18 avatar Oct 09 '19 09:10 peeyush18