Changeset 9889 in webkit for trunk/JavaScriptCore/bindings/runtime_array.cpp
- Timestamp:
- Jul 25, 2005, 3:17:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bindings/runtime_array.cpp
r9582 r9889 32 32 const ClassInfo RuntimeArrayImp::info = {"RuntimeArray", &ArrayInstanceImp::info, 0, 0}; 33 33 34 RuntimeArrayImp::RuntimeArrayImp(ExecState *exec, Bindings::Array *a) : ArrayInstanceImp (exec->lexicalInterpreter()->builtinArrayPrototype().imp(), a->getLength()) 34 RuntimeArrayImp::RuntimeArrayImp(ExecState *exec, Bindings::Array *a) 35 : ArrayInstanceImp (exec->lexicalInterpreter()->builtinArrayPrototype().imp(), a->getLength()) 35 36 { 36 37 // Always takes ownership of concrete array. … … 43 44 } 44 45 45 46 Value RuntimeArrayImp::get(ExecState *exec, const Identifier &propertyName) const 46 bool RuntimeArrayImp::getOwnProperty(ExecState *exec, const Identifier &propertyName, Value& result) const 47 47 { 48 if (propertyName == lengthPropertyName) 49 return Number(getLength()); 48 if (propertyName == lengthPropertyName) { 49 result = Number(getLength()); 50 return true; 51 } 50 52 51 53 bool ok; … … 53 55 if (ok) { 54 56 if (index >= getLength()) 55 return Undefined(); 56 return getConcreteArray()->valueAt(exec, index); 57 result = Undefined(); 58 else 59 result = getConcreteArray()->valueAt(exec, index); 60 return true; 57 61 } 58 62 59 return ObjectImp::get(exec, propertyName);63 return ArrayInstanceImp::getOwnProperty(exec, propertyName, result); 60 64 } 61 65 62 Value RuntimeArrayImp::get(ExecState *exec, unsigned index) const66 bool RuntimeArrayImp::getOwnProperty(ExecState *exec, unsigned index, Value& result) const 63 67 { 64 68 if (index >= getLength()) 65 return Undefined(); 66 return getConcreteArray()->valueAt(exec, index); 69 result = Undefined(); 70 else 71 result = getConcreteArray()->valueAt(exec, index); 72 73 return true; 67 74 } 68 75
Note:
See TracChangeset
for help on using the changeset viewer.