Summary: | [ES6] Arrow function syntax. Lexical bind "super" inside of the arrow function in generator. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | GSkachkov <gskachkov> | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, keith_miller, mark.lam, msaboff, saam, ysuzuki | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | 145132 | ||||||
Bug Blocks: | 140855 | ||||||
Attachments: |
|
Description
GSkachkov
2015-12-28 10:15:06 PST
We are already supporting arguments in arrow function in generators. Modified test example: var result = 'some-value'; class B { gen() { return result; } } class A extends B { *gen() { let arr = () => super.gen(); return arr(); } } var a = new A(); a.gen().next().value === result; //Should be true now it is : SyntaxErorr: super can only be used in a method of a derived class Created attachment 272737 [details]
Patch
Patch comming
Comment on attachment 272737 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272737&action=review Nice catch. The approach looks nice. A few nits. > Source/JavaScriptCore/parser/Parser.h:939 > { This function should be renamed to represent the returned scope is not generator's scope. And please note that this function skips arrow function and generator, but it does not skip generator function. > Source/JavaScriptCore/tests/stress/arrowfunction-lexical-bind-superproperty.js:147 > + } Could you add tests like method() { function *gen() { let arr = () => super.getValue(); arr(); } } This should be SyntaxError. Committed r197554: <http://trac.webkit.org/changeset/197554> All reviewed patches have been landed. Closing bug. |