void RuntimeArray::put(ExecState* exec, unsigned index, JSValue* value) { if (index >= getLength()) { throwError(exec, RangeError); return; } getConcreteArray()->setValueAt(exec, index, value); }
void RuntimeArray::put(ExecState* exec, const Identifier& propertyName, JSValue* value, PutPropertySlot& slot) { if (propertyName == exec->propertyNames().length) { throwError(exec, RangeError); return; } bool ok; unsigned index = propertyName.toArrayIndex(&ok); if (ok) { getConcreteArray()->setValueAt(exec, index, value); return; } JSObject::put(exec, propertyName, value, slot); }
RuntimeArray::~RuntimeArray() { delete getConcreteArray(); }