Changeset 41518 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Mar 8, 2009, 3:47:01 AM (16 years ago)
Author:
[email protected]
Message:

Bug 24268: RuntimeArray is not a fully implemented JSArray
<https://bugs.webkit.org/show_bug.cgi?id=24268>

Reviewed by Cameron Zwarich.

Don't cast a type to JSArray, just because it reportsArray as a supertype
in the JS type system. Doesn't appear feasible to create a testcase
unfortunately as setting up the failure conditions requires internal access
to JSC not present in DRT.

File:
1 edited

Legend:

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

    r41243 r41518  
    288288    while (1) {
    289289        if (curArg.isObject(&JSArray::info)) {
    290             JSArray* curArray = asArray(curArg);
    291             unsigned length = curArray->length();
     290            unsigned length = curArg->get(exec, exec->propertyNames().length).toUInt32(exec);
    292291            for (unsigned k = 0; k < length; ++k) {
    293                 if (JSValuePtr v = getProperty(exec, curArray, k))
     292                if (JSValuePtr v = getProperty(exec, curArg, k))
    294293                    arr->put(exec, n, v);
    295294                n++;
Note: See TracChangeset for help on using the changeset viewer.