Closed
Bug 1242662
Opened 9 years ago
Closed 8 years ago
Mismatched parens in uneval of function created with bind()
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla50
People
(Reporter: jruderman, Assigned: till)
References
Details
(Keywords: regression, testcase)
Attachments
(2 files)
155 bytes,
text/plain
|
Details | |
1.94 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
> var f = (function(){}).bind();
> uneval(f)
(function () {
[native code]
}
Reporter | ||
Comment 1•9 years ago
|
||
$ ~/funfuzz/autobisect-js/autoBisect.py --build="--enable-more-deterministic --enable-debug --without-intl-api" -o FAIL -p 1.js
The first bad revision is:
changeset: https://hg.mozilla.org/mozilla-central/rev/f29f1d9a3cd3
user: Till Schneidereit
summary: Bug 1000780 - Part 5: Self-host Function.prototype.bind. r=jandem
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(till)
Assignee | ||
Comment 2•9 years ago
|
||
Amazing that we didn't have a test for this.
Attachment #8712228 -
Flags: review?(jdemooij)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → till
Status: NEW → ASSIGNED
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(till)
Comment 3•9 years ago
|
||
Comment on attachment 8712228 [details] [diff] [review]
Don't emit opening paren for decompiled bound function
Review of attachment 8712228 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/tests/ecma_5/Function/function-bind.js
@@ +261,5 @@
>
> testBound(strict);
> testBound(nonstrict);
>
> +assertEq((function unbound(){"body"}).bind().toString(), `function unbound() {
AFAICS, toString works as expected but toSource/uneval is broken, because toString calls FunctionToString with lambdaParen = true, and in that case we never add parentheses.
That's really confusing because I'd expect lambdaParen = true to mean "add parentheses", not the other way around :(
Anyways, the toString test is good to have, but maybe also add one for toSource/uneval, even though these are non-standard
Attachment #8712228 -
Flags: review?(jdemooij) → review+
Comment 5•9 years ago
|
||
There's no way we're going to uplift this to beta, even after it's closed. wontfix 47.
Assignee | ||
Comment 6•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a97ebab940c6ba0f19348c38d17a2193ee75c9ab
Bug 1242662 - Don't emit opening paren for decompiled bound function. r=jandem
Comment 7•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Assignee | ||
Comment 8•8 years ago
|
||
(In reply to Johnny Stenback (:jst, jst@mozilla.com) from comment #4)
> Till, is this one ready to land?
Sorry, I somehow overlooked this :(
Flags: needinfo?(till)
You need to log in
before you can comment on or make changes to this bug.
Description
•