Closed Bug 1453006 Opened 7 years ago Closed 7 years ago

Convert FunctionSyntaxKind to an enum class

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: evilpies, Assigned: evilpies)

References

Details

Attachments

(1 file)

No description provided.
Attachment #8966625 - Flags: review?(jdemooij)
Assignee: nobody → evilpies
Comment on attachment 8966625 [details] [diff] [review] Convert FunctionSyntaxKind to an enum class Review of attachment 8966625 [details] [diff] [review]: ----------------------------------------------------------------- Nice. ::: js/src/frontend/Parser.cpp @@ +3000,5 @@ > if (!tokenStream.getToken(&tt, firstTokenModifier)) > return false; > if (tt != TokenKind::Lp) { > + error(kind == FunctionSyntaxKind::Arrow > + ? JSMSG_BAD_ARROW_ARGS : JSMSG_PAREN_BEFORE_FORMAL); Nit: \n before ":" ? @@ +3730,5 @@ > // function bodies are parsed with different yield/await settings. > { > + AwaitHandling awaitHandling = > + funbox->isAsync() || (kind == FunctionSyntaxKind::Arrow && awaitIsKeyword()) > + ? AwaitIsKeyword : AwaitIsName; Same here. Also maybe add parentheses around the condition while you're here - it's not obvious to me how `a || b ? x : y` is parsed.
Attachment #8966625 - Flags: review?(jdemooij) → review+
(Btw Splinter flags this as a "WINDOWS PATCH" but we can probably ignore that...)
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1b3203bbe43b Convert FunctionSyntaxKind to an enum class. r=jandem
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: