Changeset 41028 in webkit


Ignore:
Timestamp:
Feb 16, 2009 4:40:39 PM (15 years ago)
Author:
weinig@apple.com
Message:

JavaScriptCore:

2009-02-16 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Fix for <rdar://problem/6468156>
REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)

No performance regression.

  • runtime/Arguments.cpp: (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been overridden.

LayoutTests:

2009-02-16 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Add tests for <rdar://problem/6468156>
REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)

  • fast/js/function-apply-expected.txt:
  • fast/js/resources/function-apply.js: Add cases covering setting arugments.length and Array.length explicitly or implicitly using Array.prototype.unshift.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r41023 r41028  
     12009-02-16  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Fix for <rdar://problem/6468156>
     6        REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
     7
     8        No performance regression.
     9
     10        * runtime/Arguments.cpp:
     11        (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
     12        overridden.
     13
    1142009-02-16  Mark Rowe  <mrowe@apple.com>
    215
  • trunk/JavaScriptCore/runtime/Arguments.cpp

    r39670 r41028  
    7272void Arguments::fillArgList(ExecState* exec, ArgList& args)
    7373{
     74    if (UNLIKELY(d->overrodeLength)) {
     75        unsigned length = get(exec, exec->propertyNames().length).toUInt32(exec);
     76        for (unsigned i = 0; i < length; i++)
     77            args.append(get(exec, i));
     78        return;
     79   }
     80
    7481    if (LIKELY(!d->deletedArguments)) {
    7582        if (LIKELY(!d->numParameters)) {
  • trunk/LayoutTests/ChangeLog

    r41027 r41028  
     12009-02-16  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Add tests for <rdar://problem/6468156>
     6        REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
     7
     8        * fast/js/function-apply-expected.txt:
     9        * fast/js/resources/function-apply.js: Add cases covering setting arugments.length and
     10        Array.length explicitly or implicitly using Array.prototype.unshift.
     11
    1122009-02-16  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/LayoutTests/fast/js/function-apply-expected.txt

    r36779 r41028  
    2020PASS arrayApplyDelete3([1, 2, 3]) is 3
    2121PASS arrayApplyDeleteLength([1, 2, 3]) is 3
     22PASS argumentsApplyChangeLength1(1) is 2
     23PASS argumentsApplyChangeLength2(1) is 2
     24PASS argumentsApplyChangeLength3(1) is 2
     25PASS argumentsApplyChangeLength4(1) is 0
     26PASS argumentsApplyChangeLength5(1) is 0
     27PASS arrayApplyChangeLength1() is 2
     28PASS arrayApplyChangeLength2() is 2
     29PASS arrayApplyChangeLength3() is 2
     30PASS arrayApplyChangeLength4() is 0
    2231PASS successfullyParsed is true
    2332
  • trunk/LayoutTests/fast/js/resources/function-apply.js

    r36779 r41028  
    175175shouldBe("arrayApplyDeleteLength([1, 2, 3])", "3");
    176176
     177
     178function argumentsApplyChangeLength1()
     179{
     180    function f() {
     181        return arguments.length;
     182    };
     183    arguments.length = 2;
     184    return f.apply(null, arguments);
     185}
     186
     187
     188function argumentsApplyChangeLength2()
     189{
     190    function f(a) {
     191        return arguments.length;
     192    };
     193    arguments.length = 2;
     194    return f.apply(null, arguments);
     195}
     196
     197
     198function argumentsApplyChangeLength3()
     199{
     200    function f(a, b, c) {
     201        return arguments.length;
     202    };
     203    arguments.length = 2;
     204    return f.apply(null, arguments);
     205};
     206
     207function argumentsApplyChangeLength4()
     208{
     209    function f() {
     210        return arguments.length;
     211    };
     212    arguments.length = 0;
     213    return f.apply(null, arguments);
     214};
     215
     216function argumentsApplyChangeLength5()
     217{
     218    function f() {
     219        return arguments.length;
     220    };
     221    arguments.length = "Not A Number";
     222    return f.apply(null, arguments);
     223}
     224
     225shouldBe("argumentsApplyChangeLength1(1)", "2");
     226shouldBe("argumentsApplyChangeLength2(1)", "2");
     227shouldBe("argumentsApplyChangeLength3(1)", "2");
     228shouldBe("argumentsApplyChangeLength4(1)", "0");
     229shouldBe("argumentsApplyChangeLength5(1)", "0");
     230
     231function arrayApplyChangeLength1()
     232{
     233    function f() {
     234        return arguments.length;
     235    };
     236    var array = [];
     237    array.length = 2;
     238    return f.apply(null, array);
     239}
     240
     241function arrayApplyChangeLength2()
     242{
     243    function f(a) {
     244        return arguments.length;
     245    };
     246    var array = [];
     247    array.length = 2;
     248    return f.apply(null, array);
     249}
     250
     251function arrayApplyChangeLength3()
     252{
     253    function f(a, b, c) {
     254        return arguments.length;
     255    };
     256    var array = [];
     257    array.length = 2;
     258    return f.apply(null, array);
     259}
     260
     261function arrayApplyChangeLength4()
     262{
     263    function f() {
     264        return arguments.length;
     265    };
     266    var array = [1];
     267    array.length = 0;
     268    return f.apply(null, array);
     269};
     270
     271shouldBe("arrayApplyChangeLength1()", "2");
     272shouldBe("arrayApplyChangeLength2()", "2");
     273shouldBe("arrayApplyChangeLength3()", "2");
     274shouldBe("arrayApplyChangeLength4()", "0");
     275
    177276var successfullyParsed = true;
Note: See TracChangeset for help on using the changeset viewer.