Summary: | REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mihnea Ovidenie <mihnea> | ||||||||
Component: | WebCore JavaScript | Assignee: | Cameron Zwarich (cpst) <zwarich> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | ap, ddkilzer, sam, zwarich | ||||||||
Priority: | P1 | Keywords: | HasReduction, InRadar, Regression | ||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Mac | ||||||||||
OS: | OS X 10.5 | ||||||||||
Attachments: |
|
Description
Mihnea Ovidenie
2009-03-02 07:44:05 PST
Confirmed as a regression from 3.1.2. Sorry, from 3.2.1 As expected, there is an unreported parsing error when attempting to parse the event handler. I'll try to use Bison's debugging to figure out why. This regressed between r38592 and r38645. I suspect it was caused by r38635: http://trac.webkit.org/changeset/38635 This is the problem, at the top of constructFunction() in FunctionConstructor.cpp: UString program; if (args.isEmpty()) program = "(function(){})"; else if (args.size() == 1) program = "(function(){" + args.at(exec, 0).toString(exec) + "})"; else { program = "(function(" + args.at(exec, 0).toString(exec); for (size_t i = 1; i < args.size() - 1; i++) program += "," + args.at(exec, i).toString(exec); program += "){" + args.at(exec, args.size() - 1).toString(exec) + "})"; } This is possibly incorrect when anything in the middle has a single-line comment. The fix is to add newlines after substitutions. I'll assign this to myself. Created attachment 28255 [details]
Reduction
If the test passes, an alert is displayed with the message PASS.
Created attachment 28258 [details]
Proposed patch (without tests)
Here's the fix. It needs a ChangeLog and some tests, for both the event handler and "new Function(...)" cases. I should be able to get to it by tomorrow evening.
*** Bug 24482 has been marked as a duplicate of this bug. *** Per the duplicate, this is <rdar://problem/6663472>. Created attachment 28450 [details]
Proposed patch
Comment on attachment 28450 [details]
Proposed patch
r=me
Landed in r41565. |