Bug 5939 - final comma in javascript object prevents parsing
Summary: final comma in javascript object prevents parsing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL: http://ruphus.com/stash/comma-problem...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-04 23:27 PST by pathall
Modified: 2006-01-11 09:19 PST (History)
0 users

See Also:


Attachments
Patch and test case (2.22 KB, patch)
2006-01-03 22:30 PST, Ricci Adams
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pathall 2005-12-04 23:27:08 PST
In firefox the final comma in the object "pt" doesn't prevent the script from
being parsed, but in Safari it does.
Comment 1 Ricci Adams 2006-01-03 22:30:05 PST
Created attachment 5469 [details]
Patch and test case
Comment 2 Darin Adler 2006-01-04 13:03:29 PST
Comment on attachment 5469 [details]
Patch and test case

Does adding this rule create any conflicts in the grammar? If not, then we're
fine. If so, we should look for a way of fixing things so that there are no
conflicts.

The way to find out is to build and look for output from bison when compiling
the grammar file.
Comment 3 Ricci Adams 2006-01-04 23:43:53 PST
Darin,

I do not see any conflicts when bisoning JavaScriptCore/kjs/grammar.y with my patch.

However, my grep did turn up conflicts in the CSS parser, which I documented here: http://
bugzilla.opendarwin.org/show_bug.cgi?id=6380
Comment 4 Maciej Stachowiak 2006-01-06 01:49:05 PST
Comment on attachment 5469 [details]
Patch and test case

r=me