[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:18:00 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=174212
--- Comment #2 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
>> 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.
well, this isn't quite right I guess, you still need the `(match(EQUAL) || match(SEMICOLON))` thing in the if statement. Should work with that though
--
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/a21c4b7b/attachment-0001.html>
More information about the webkit-unassigned
mailing list