Ignore:
Timestamp:
Mar 19, 2009, 7:04:58 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Oliver Hunt.

Bug 24350: REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
<https://bugs.webkit.org/show_bug.cgi?id=24350>
<rdar://problem/6674182>

The SPAW editor's JavaScript assumes that toString() on a function
constructed with the Function constructor produces a function with
a newline after the opening brace.

JavaScriptCore:

  • runtime/FunctionConstructor.cpp: (JSC::constructFunction): Add a newline after the opening brace of the function's source code.

LayoutTests:

  • fast/js/function-constructor-newline-after-brace-expected.txt: Added.
  • fast/js/function-constructor-newline-after-brace.html: Added.
  • fast/js/resources/function-constructor-newline-after-brace.js: Added.
File:
1 edited

Legend:

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

    r41565 r41851  
    9898        program = "(function(){})";
    9999    else if (args.size() == 1)
    100         program = "(function(){" + args.at(exec, 0).toString(exec) + "\n})";
     100        program = "(function(){\n" + 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) + "\n})";
     105        program += "){\n" + args.at(exec, args.size() - 1).toString(exec) + "\n})";
    106106    }
    107107
Note: See TracChangeset for help on using the changeset viewer.