Bug 13622

Summary: Decompiler omits trailing comma in array literal
Product: WebKit Reporter: Jesse Ruderman <jruderman>
Component: JavaScriptCoreAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: mrowe
Priority: P2 Keywords: HasReduction
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 13638    
Attachments:
Description Flags
Add one to the elision value on "trailing elisions"
mrowe: review-
Print extra comma if array expression has element list and elisions darin: review+

Jesse Ruderman
Reported 2007-05-08 00:49:10 PDT
(function(){ return [1,,,] }) function () { return [1,,]; } Found with jsfunfuzz.
Attachments
Add one to the elision value on "trailing elisions" (3.93 KB, patch)
2007-05-09 13:44 PDT, Kimmo Kinnunen
mrowe: review-
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+
Kimmo Kinnunen
Comment 1 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.
Eric Seidel (no email)
Comment 2 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,,]
Darin Adler
Comment 3 2007-05-09 19:26:46 PDT
Comment on attachment 14442 [details] Add one to the elision value on "trailing elisions" r=me
Mark Rowe (bdash)
Comment 4 2007-05-11 02:14:19 PDT
Landed in r21393.
Mark Rowe (bdash)
Comment 5 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.
Mark Rowe (bdash)
Comment 6 2007-05-11 03:27:58 PDT
Rolled out in r21399.
Kimmo Kinnunen
Comment 7 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
Darin Adler
Comment 8 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
Mark Rowe (bdash)
Comment 9 2007-05-14 19:16:41 PDT
Landed in r21473.
Note You need to log in before you can comment on or make changes to this bug.