Closed Bug 1353692 Opened 7 years ago Closed 7 years ago

Don't allow function closure syntax for async functions

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Test case:
---
void async function()0;
---

Expected: Throws SyntaxError
Actual: No SyntaxError
Attached patch bug1353692.patchSplinter Review
Moved the check into the |if (kind != Arrow) { ... }| block, so we don't need to special case async arrow-functions.

Also removed the PropertyType::Constructor/PropertyType::DerivedConstructor checks from Parser::classDefinition() because Parser::propertyName() never sets |propType| to PropertyType::Constructor/PropertyType::DerivedConstructor.
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8855392 - Flags: review?(arai.unmht)
Comment on attachment 8855392 [details] [diff] [review]
bug1353692.patch

Review of attachment 8855392 [details] [diff] [review]:
-----------------------------------------------------------------

thanks!
Attachment #8855392 - Flags: review?(arai.unmht) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/45d48a852a0c
Don't allow function expression closure syntax for async functions. r=arai
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/45d48a852a0c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: