Summary: | REGRESSION: JSC can't round trip an object literal | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> | ||||||
Component: | JavaScriptCore | Assignee: | Oliver Hunt <oliver> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | darin, jruderman, sam, slewis | ||||||
Priority: | P2 | Keywords: | HasReduction, Regression | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 13638 | ||||||||
Attachments: |
|
Description
Oliver Hunt
2008-01-25 19:01:42 PST
I have a one line fix for this This is a regression from shipping Safari. toSource and uneval have to put parens around functions, but toString doesn't have to. JSC's current behavior matches Spidermonkey. Never mind, I misread the bug. this also occurs with function expressions I was wrong, it looks like our current funciton expression behaviour is sufficient Created attachment 18697 [details]
Patch to fix the bug
Comment on attachment 18697 [details]
Patch to fix the bug
r=me
But is this a bug fix or not?
Comment on attachment 18697 [details]
Patch to fix the bug
This is a bug fix -- the current code means Function.toString can produce incorrect code.
Maciej suggested an approach that would not use unnecessary ()'s for object literals.
Created attachment 18699 [details]
New version of fix
No longer introduce unnecessary ()'s
Comment on attachment 18699 [details]
New version of fix
r=me
Landed r29802 |