Ignore:
Timestamp:
Feb 22, 2016, 11:41:00 AM (9 years ago)
Author:
[email protected]
Message:

[JSC shell] Don't put empty arguments array to VM.
https://bugs.webkit.org/show_bug.cgi?id=154516

Patch by Konstantin Tokarev <Konstantin Tokarev> on 2016-02-22
Reviewed by Geoffrey Garen.

This allows arrowfunction-lexical-bind-arguments-top-level test to pass
in jsc as well as in browser.

Source/JavaScriptCore:

  • jsc.cpp:

(GlobalObject::finishCreation):

LayoutTests:

  • js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:

Removed @ skip annotation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r196745 r196948  
    753753#endif
    754754
    755         JSArray* array = constructEmptyArray(globalExec(), 0);
    756         for (size_t i = 0; i < arguments.size(); ++i)
    757             array->putDirectIndex(globalExec(), i, jsString(globalExec(), arguments[i]));
    758         putDirect(vm, Identifier::fromString(globalExec(), "arguments"), array);
    759        
     755        if (!arguments.isEmpty()) {
     756            JSArray* array = constructEmptyArray(globalExec(), 0);
     757            for (size_t i = 0; i < arguments.size(); ++i)
     758                array->putDirectIndex(globalExec(), i, jsString(globalExec(), arguments[i]));
     759            putDirect(vm, Identifier::fromString(globalExec(), "arguments"), array);
     760        }
     761
    760762        putDirect(vm, Identifier::fromString(globalExec(), "console"), jsUndefined());
    761763    }
Note: See TracChangeset for help on using the changeset viewer.