Changeset 41565 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Mar 10, 2009, 3:48:46 PM (16 years ago)
Author:
[email protected]
Message:

2009-03-10 Cameron Zwarich <[email protected]>

Reviewed by Geoff Garen.

Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
<https://bugs.webkit.org/show_bug.cgi?id=24291>
<rdar://problem/6663472>

Add an extra newline to the end of the body of the program text constructed
by the Function constructor for parsing. This allows single line comments to
be handled correctly by the parser.

JavaScriptCore:

  • runtime/FunctionConstructor.cpp: (JSC::constructFunction):

LayoutTests:

  • fast/events/onload-single-line-comment-expected.txt: Added.
  • fast/events/onload-single-line-comment.html: Added.
  • fast/js/function-constructor-single-line-comment-expected.txt: Added.
  • fast/js/function-constructor-single-line-comment.html: Added.
  • fast/js/resources/function-constructor-single-line-comment.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/FunctionConstructor.cpp

    r40993 r41565  
    9898        program = "(function(){})";
    9999    else if (args.size() == 1)
    100         program = "(function(){" + args.at(exec, 0).toString(exec) + "})";
     100        program = "(function(){" + args.at(exec, 0).toString(exec) + "\n})";
    101101    else {
    102102        program = "(function(" + args.at(exec, 0).toString(exec);
    103103        for (size_t i = 1; i < args.size() - 1; i++)
    104104            program += "," + args.at(exec, i).toString(exec);
    105         program += "){" + args.at(exec, args.size() - 1).toString(exec) + "})";
     105        program += "){" + args.at(exec, args.size() - 1).toString(exec) + "\n})";
    106106    }
    107107
Note: See TracChangeset for help on using the changeset viewer.