X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63:/runtime/JSVariableObject.cpp?ds=sidebyside diff --git a/runtime/JSVariableObject.cpp b/runtime/JSVariableObject.cpp index a36cefa..7365001 100644 --- a/runtime/JSVariableObject.cpp +++ b/runtime/JSVariableObject.cpp @@ -30,6 +30,7 @@ #include "JSVariableObject.h" #include "PropertyNameArray.h" +#include "PropertyDescriptor.h" namespace JSC { @@ -41,30 +42,30 @@ bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propert return JSObject::deleteProperty(exec, propertyName); } -void JSVariableObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) +void JSVariableObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { SymbolTable::const_iterator end = symbolTable().end(); for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) { - if (!(it->second.getAttributes() & DontEnum)) + if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties)) propertyNames.add(Identifier(exec, it->first.get())); } - JSObject::getPropertyNames(exec, propertyNames); + JSObject::getOwnPropertyNames(exec, propertyNames, mode); } -bool JSVariableObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const +bool JSVariableObject::isVariableObject() const { - SymbolTableEntry entry = symbolTable().get(propertyName.ustring().rep()); - if (!entry.isNull()) { - attributes = entry.getAttributes() | DontDelete; - return true; - } - return JSObject::getPropertyAttributes(exec, propertyName, attributes); + return true; } -bool JSVariableObject::isVariableObject() const +bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertyDescriptor& descriptor) { - return true; + SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep()); + if (!entry.isNull()) { + descriptor.setDescriptor(registerAt(entry.getIndex()).jsValue(), entry.getAttributes() | DontDelete); + return true; + } + return false; } } // namespace JSC