void JSLexicalEnvironment::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { JSLexicalEnvironment* thisObject = jsCast<JSLexicalEnvironment*>(cell); ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject)); if (thisObject->symbolTablePut(exec, propertyName, value, slot.isStrictMode())) return; // We don't call through to JSObject because __proto__ and getter/setter // properties are non-standard extensions that other implementations do not // expose in the lexicalEnvironment object. ASSERT(!thisObject->hasGetterSetterProperties()); thisObject->putOwnDataProperty(exec->vm(), propertyName, value, slot); }
bool JSLexicalEnvironment::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { JSLexicalEnvironment* thisObject = jsCast<JSLexicalEnvironment*>(cell); ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject)); bool shouldThrowReadOnlyError = slot.isStrictMode() || thisObject->isLexicalScope(); bool ignoreReadOnlyErrors = false; bool putResult = false; if (symbolTablePutInvalidateWatchpointSet(thisObject, exec, propertyName, value, shouldThrowReadOnlyError, ignoreReadOnlyErrors, putResult)) return putResult; // We don't call through to JSObject because __proto__ and getter/setter // properties are non-standard extensions that other implementations do not // expose in the lexicalEnvironment object. ASSERT(!thisObject->hasGetterSetterProperties()); return thisObject->putOwnDataProperty(exec->vm(), propertyName, value, slot); }
bool JSLexicalEnvironment::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) { JSLexicalEnvironment* thisObject = jsCast<JSLexicalEnvironment*>(object); if (thisObject->symbolTableGet(propertyName, slot)) return true; unsigned attributes; if (JSValue value = thisObject->getDirect(exec->vm(), propertyName, attributes)) { slot.setValue(thisObject, attributes, value); return true; } // We don't call through to JSObject because there's no way to give a // lexical environment object getter properties or a prototype. ASSERT(!thisObject->hasGetterSetterProperties()); ASSERT(thisObject->prototype().isNull()); return false; }