Bug 153977

Summary: [ES6] Arrow function syntax. Using eval with 'super'/'super()' in arrow function within the class should not lead to Syntax error
Product: WebKit Reporter: GSkachkov <gskachkov>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 150893    
Bug Blocks: 140855, 154027    

Description GSkachkov 2016-02-07 23:52:48 PST
Using eval with 'super'/'super()' in arrow function within the class should not lead to Syntax error:

const testValue  = 'test-value';

class A {
    constructor() {
        this.idValue = testValue;
    }
};

class B extends A {
  constructor (beforeSuper) {
      var arrow = () => eval('(() => super())()');
      arrow();
  }
};

let b = new B();
b.idValue == testValue; //true
Comment 1 GSkachkov 2016-02-28 14:44:06 PST
There is 15.1 https://tc39.github.io/ecma262/#sec-scripts-static-semantics-early-errors that stats:
ScriptBody:StatementList
#It is a Syntax Error if StatementList Contains super unless the source code containing super is eval code that is being processed by a direct eval that is contained in function code that is not the function code of an ArrowFunction.
#It is a Syntax Error if StatementList Contains NewTarget unless the source code containing NewTarget is eval code that is being processed by a direct eval that is contained in function code that is not the function code of an ArrowFunction.
Comment 2 GSkachkov 2016-04-04 13:43:54 PDT
Already implemented in https://bugs.webkit.org/show_bug.cgi?id=150893

*** This bug has been marked as a duplicate of bug 150893 ***