CoverInitName not supported in async arrow function parameters

RESOLVED FIXED in Firefox 52

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
Test case:
---
async({a = 0}) => {}
---

Expected: No syntax error
Actual: Throws syntax error "missing : after property id"
(Assignee)

Updated

2 years ago
Assignee: nobody → andrebargull
(Assignee)

Comment 1

2 years ago
Created attachment 8806375 [details] [diff] [review]
Bug1314083.patch

The detection of unparenthesized "async" in Parser::memberExpr() isn't necessary to fix this bug, I've only added it to give better error messages in some cases.
Attachment #8806375 - Flags: review?(arai.unmht)
Comment on attachment 8806375 [details] [diff] [review]
Bug1314083.patch

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

Thank you :D

::: js/src/tests/ecma_2017/AsyncFunctions/cover-init-name-syntax.js
@@ +44,5 @@
> +    typeof async({a = 1}, {b = 2}, {c = 3} = {});
> +`), SyntaxError);
> +assertThrowsInstanceOf(() => eval(`
> +    typeof async({a = 1}, {b = 2} = {}, {c = 3} = {});
> +`), SyntaxError);

would be nice to add |a.async({a = 1});| case too.
Attachment #8806375 - Flags: review?(arai.unmht) → review+
(Assignee)

Comment 3

2 years ago
Created attachment 8807090 [details] [diff] [review]
Bug-1314083.patch

Updated patch to include additional test per review comment. Carrying r+ from arai.
Attachment #8806375 - Attachment is obsolete: true
Attachment #8807090 - Flags: review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 4

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a36d67577d8
Handle destructuring-only syntax when initially parsing async arrow parameters. r=arai
Keywords: checkin-needed

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8a36d67577d8
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.