]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/JSVariableObject.cpp
JavaScriptCore-903.tar.gz
[apple/javascriptcore.git] / runtime / JSVariableObject.cpp
index a36cefacb0b424effc1c125e11788e44f22131ef..abe9bbbc2f5d62953fe59c417b36c729eaa82a30 100644 (file)
 #include "JSVariableObject.h"
 
 #include "PropertyNameArray.h"
 #include "JSVariableObject.h"
 
 #include "PropertyNameArray.h"
+#include "PropertyDescriptor.h"
 
 namespace JSC {
 
 bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
 {
 
 namespace JSC {
 
 bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
 {
-    if (symbolTable().contains(propertyName.ustring().rep()))
+    if (symbolTable().contains(propertyName.impl()))
         return false;
 
     return JSObject::deleteProperty(exec, propertyName);
 }
 
         return false;
 
     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) {
 {
     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()));
     }
     
             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.impl());
+    if (!entry.isNull()) {
+        descriptor.setDescriptor(registerAt(entry.getIndex()).get(), entry.getAttributes() | DontDelete);
+        return true;
+    }
+    return false;
 }
 
 } // namespace JSC
 }
 
 } // namespace JSC