JSGlobalLexicalEnvironment.cpp [plain text]
#include "config.h"
#include "JSGlobalLexicalEnvironment.h"
#include "JSCInlines.h"
namespace JSC {
const ClassInfo JSGlobalLexicalEnvironment::s_info = { "JSGlobalLexicalEnvironment", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSGlobalLexicalEnvironment) };
void JSGlobalLexicalEnvironment::destroy(JSCell* cell)
{
static_cast<JSGlobalLexicalEnvironment*>(cell)->JSGlobalLexicalEnvironment::~JSGlobalLexicalEnvironment();
}
bool JSGlobalLexicalEnvironment::getOwnPropertySlot(JSObject* object, ExecState*, PropertyName propertyName, PropertySlot& slot)
{
JSGlobalLexicalEnvironment* thisObject = jsCast<JSGlobalLexicalEnvironment*>(object);
return symbolTableGet(thisObject, propertyName, slot);
}
bool JSGlobalLexicalEnvironment::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSGlobalLexicalEnvironment* thisObject = jsCast<JSGlobalLexicalEnvironment*>(cell);
ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
bool alwaysThrowWhenAssigningToConstProperty = true;
bool ignoreConstAssignmentError = slot.isInitialization();
bool putResult = false;
symbolTablePutTouchWatchpointSet(thisObject, exec, propertyName, value, alwaysThrowWhenAssigningToConstProperty, ignoreConstAssignmentError, putResult);
return putResult;
}
bool JSGlobalLexicalEnvironment::isConstVariable(UniquedStringImpl* impl)
{
SymbolTableEntry entry = symbolTable()->get(impl);
ASSERT(!entry.isNull());
return entry.isReadOnly();
}
}