Bug 153977 - [ES6] Arrow function syntax. Using eval with 'super'/'super()' in arrow function within the class should not lead to Syntax error
Summary: [ES6] Arrow function syntax. Using eval with 'super'/'super()' in arrow funct...
Status: RESOLVED DUPLICATE of bug 150893
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 150893
Blocks: 140855 154027
  Show dependency treegraph
 
Reported: 2016-02-07 23:52 PST by GSkachkov
Modified: 2016-04-04 13:43 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***