diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp index 2ac2524c5..f1041fba3 100644 --- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp +++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp @@ -6,13 +6,13 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -29,47 +29,46 @@ #include "config.h" #include "JSSymbolTableObject.h" -#include "JSActivation.h" -#include "JSGlobalObject.h" -#include "JSNameScope.h" -#include "Operations.h" +#include "JSCInlines.h" #include "PropertyNameArray.h" namespace JSC { +const ClassInfo JSSymbolTableObject::s_info = { "SymbolTableObject", &Base::s_info, nullptr, CREATE_METHOD_TABLE(JSSymbolTableObject) }; + void JSSymbolTableObject::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - Base::visitChildren(thisObject, visitor); - visitor.append(&thisObject->m_symbolTable); + visitor.append(thisObject->m_symbolTable); } bool JSSymbolTableObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) { JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(cell); - if (thisObject->symbolTable()->contains(propertyName.publicName())) + if (thisObject->symbolTable()->contains(propertyName.uid())) return false; - return JSObject::deleteProperty(thisObject, exec, propertyName); + return Base::deleteProperty(thisObject, exec, propertyName); } void JSSymbolTableObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(object); { - ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock); + ConcurrentJSLocker locker(thisObject->symbolTable()->m_lock); SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker); for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) { - if (!(it->value.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties)) - propertyNames.add(Identifier(exec, it->key.get())); + if (!(it->value.getAttributes() & DontEnum) || mode.includeDontEnumProperties()) { + if (it->key->isSymbol() && !propertyNames.includeSymbolProperties()) + continue; + propertyNames.add(Identifier::fromUid(exec, it->key.get())); + } } } - - JSObject::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode); + + Base::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode); } } // namespace JSC |