Closed
Bug 1255167
Opened 8 years ago
Closed 8 years ago
Default object arguments are not defined as lexical dependencies.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: stefan, Assigned: mrrrgn)
References
Details
Attachments
(1 file)
2.16 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 Steps to reproduce: Define the following function: f = function(a){ (function({aa = a}){ console.log('result: ' + aa); })({}); } invoke it f(42) Actual results: ReferenceError: a is not defined Expected results: console log: result: 42
Comment 1•8 years ago
|
||
maybe similar issue to bug 1126361
Assignee | ||
Comment 2•8 years ago
|
||
The right hand side of the destructuring assignment isn't being added to pc->lexdeps. Adding it will ensure that it is defined in the inner function's scope via Parser::leaveFunction Coming up with a patch for this in a jiffy.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → winter2718
Assignee | ||
Comment 3•8 years ago
|
||
try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9875b2e0eced
Assignee | ||
Updated•8 years ago
|
Summary: Function parameter gets optimized away when used as the default of a named parameter only → Default object arguments are not defined as lexical dependencies.
Assignee | ||
Updated•8 years ago
|
Attachment #8760939 -
Flags: review?(jorendorff)
Updated•8 years ago
|
Attachment #8760939 -
Flags: review?(jorendorff) → review+
Pushed by mphillips@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/095c359e97ad Default destructuring arguments should show up as lexical dependencies; r=jorendorff
Comment 5•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/095c359e97ad
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•