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: | JavaScriptCore | Assignee: | 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 | ||
GSkachkov
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
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
GSkachkov
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.
GSkachkov
Already implemented in https://bugs.webkit.org/show_bug.cgi?id=150893
*** This bug has been marked as a duplicate of bug 150893 ***