Ignore:
Timestamp:
Jun 28, 2008, 10:38:37 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-06-28 Darin Adler <Darin Adler>

Reviewed by Sam and Cameron.

Test: fast/js/array-holes.html

  • kjs/ArrayPrototype.cpp: (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of JSArray::getItem -- need to handle properties from the prototype chain instead of ignoring them.
  • kjs/JSArray.cpp: Removed getItem.
  • kjs/JSArray.h: Ditto.

WebCore:

2008-06-28 Darin Adler <Darin Adler>

Reviewed by Sam and Cameron.

  • bridge/jni/jni_utility.cpp: (KJS::Bindings::convertArrayInstanceToJavaArray): Use get instead of getItem, since we always want to consider values from the prototypes when looking at JavaScript arrays.

LayoutTests:

2008-06-28 Darin Adler <Darin Adler>

Reviewed by Sam and Cameron.

  • fast/js/array-holes-expected.txt: Added.
  • fast/js/array-holes.html: Added.
  • fast/js/resources/array-holes.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSArray.cpp

    r34867 r34868  
    132132}
    133133
    134 JSValue* JSArray::getItem(unsigned i) const
    135 {
    136     ASSERT(i <= maxArrayIndex);
    137 
    138     ArrayStorage* storage = m_storage;
    139 
    140     if (i < storage->m_vectorLength) {
    141         JSValue* value = storage->m_vector[i];
    142         return value ? value : jsUndefined();
    143     }
    144 
    145     SparseArrayValueMap* map = storage->m_sparseValueMap;
    146     if (!map)
    147         return jsUndefined();
    148 
    149     JSValue* value = map->get(i);
    150     return value ? value : jsUndefined();
    151 }
    152 
    153134JSValue* JSArray::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
    154135{
Note: See TracChangeset for help on using the changeset viewer.