Bug 13622 - Decompiler omits trailing comma in array literal
Summary: Decompiler omits trailing comma in array literal
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: HasReduction
Depends on:
Blocks: 13638
  Show dependency treegraph
 
Reported: 2007-05-08 00:49 PDT by Jesse Ruderman
Modified: 2007-05-14 19:16 PDT (History)
1 user (show)

See Also:


Attachments
Add one to the elision value on "trailing elisions" (3.93 KB, patch)
2007-05-09 13:44 PDT, Kimmo Kinnunen
mrowe: review-
Details | Formatted Diff | Diff
Print extra comma if array expression has element list and elisions (8.52 KB, patch)
2007-05-14 01:35 PDT, Kimmo Kinnunen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Ruderman 2007-05-08 00:49:10 PDT
(function(){ return [1,,,] })
function () 
{
  return [1,,];
}

Found with jsfunfuzz.
Comment 1 Kimmo Kinnunen 2007-05-09 13:44:17 PDT
Created attachment 14442 [details]
Add one to the elision value on "trailing elisions"

The parser consumes the missing comma on trailing elisions. 

In the middle (i.e [1,,,3]) -case doesn't need to have the addition, since the consumed comma is also printed when the array has 'next' ptr in the element list.
Comment 2 Eric Seidel (no email) 2007-05-09 17:03:16 PDT
Comment on attachment 14442 [details]
Add one to the elision value on "trailing elisions"

I'd feel better if you also included a test of the 0 and 1 cases as well.  Maybe 2, just for kicks.

[1]
[1,]
[1,,]
Comment 3 Darin Adler 2007-05-09 19:26:46 PDT
Comment on attachment 14442 [details]
Add one to the elision value on "trailing elisions"

r=me
Comment 4 Mark Rowe (bdash) 2007-05-11 02:14:19 PDT
Landed in r21393.
Comment 5 Mark Rowe (bdash) 2007-05-11 03:19:26 PDT
This breaks a JSCore test by changing [1,,].length from 2 to 3.  I'm going to roll out the change now so that the failure can be addressed.
Comment 6 Mark Rowe (bdash) 2007-05-11 03:27:58 PDT
Rolled out in r21399.
Comment 7 Kimmo Kinnunen 2007-05-14 01:35:15 PDT
Created attachment 14542 [details]
Print extra comma if array expression has element list and elisions

contains few additional tests
Comment 8 Darin Adler 2007-05-14 08:10:25 PDT
Comment on attachment 14542 [details]
Print extra comma if array expression has element list and elisions

r=me
Comment 9 Mark Rowe (bdash) 2007-05-14 19:16:41 PDT
Landed in r21473.