[Webkit-unassigned] [Bug 174212] [JSC] Add support for class fields to the parser
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 6 14:14:28 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=174212
--- Comment #1 from Caitlin Potter (:caitp) <caitp at igalia.com> ---
Comment on attachment 314736
--> https://bugs.webkit.org/attachment.cgi?id=314736
WIP data field parsing
View in context: https://bugs.webkit.org/attachment.cgi?id=314736&action=review
just some ideas (also, it would be good to test your implementation's interaction with the contextual keywords, the generator `*` thing, etc.
> Source/JavaScriptCore/parser/Parser.cpp:2725
> next();
What about something like:
```
next();
if ({classFieldsEnabled} && !isGenerator && !isAsyncMethod) {
TreeExpression initializer = 0;
if (consume(EQUAL))
initializer = parseAssignmentExpression(context);
consumeOrFail(SEMICOLON); // I think class fields require the `;` at the end, per https://tc39.github.io/proposal-class-fields/#sec-updated-syntax
// TODO: add to the AST node, keeping track of whether the field is static or not, and its initializer.
continue; // parse the next class element
}
```
Then we could avoid having that stuff in parseMethod where it's accessible through more paths.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170706/af19183d/attachment.html>
More information about the webkit-unassigned
mailing list