Beispiel #1
0
bool StringObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
    VM& vm = exec->vm();
    auto scope = DECLARE_THROW_SCOPE(vm);

    StringObject* thisObject = jsCast<StringObject*>(cell);

    if (UNLIKELY(isThisValueAltered(slot, thisObject)))
        return ordinarySetSlow(exec, thisObject, propertyName, value, slot.thisValue(), slot.isStrictMode());

    if (propertyName == vm.propertyNames->length)
        return typeError(exec, scope, slot.isStrictMode(), ASCIILiteral(ReadonlyPropertyWriteError));
    if (Optional<uint32_t> index = parseIndex(propertyName))
        return putByIndex(cell, exec, index.value(), value, slot.isStrictMode());
    return JSObject::put(cell, exec, propertyName, value, slot);
}
Beispiel #2
0
void RuntimeArray::putVirtual(ExecState* exec, unsigned index, JSValue value)
{
    putByIndex(this, exec, index, value);
}
Beispiel #3
0
void JSCell::putVirtual(ExecState* exec, unsigned identifier, JSValue value)
{
    putByIndex(this, exec, identifier, value);
}