diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/ScopeChain.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/ScopeChain.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Source/JavaScriptCore/runtime/ScopeChain.cpp b/Source/JavaScriptCore/runtime/ScopeChain.cpp index 976cff6..026d729 100644 --- a/Source/JavaScriptCore/runtime/ScopeChain.cpp +++ b/Source/JavaScriptCore/runtime/ScopeChain.cpp @@ -31,16 +31,16 @@ namespace JSC { #ifndef NDEBUG -void ScopeChainNode::print() const +void ScopeChainNode::print() { ScopeChainIterator scopeEnd = end(); for (ScopeChainIterator scopeIter = begin(); scopeIter != scopeEnd; ++scopeIter) { - DeprecatedPtr<JSObject> o = *scopeIter; + JSObject* o = scopeIter->get(); PropertyNameArray propertyNames(globalObject->globalExec()); o->getPropertyNames(globalObject->globalExec(), propertyNames); PropertyNameArray::const_iterator propEnd = propertyNames.end(); - fprintf(stderr, "----- [scope %p] -----\n", o.get()); + fprintf(stderr, "----- [scope %p] -----\n", o); for (PropertyNameArray::const_iterator propIter = propertyNames.begin(); propIter != propEnd; propIter++) { Identifier name = *propIter; fprintf(stderr, "%s, ", name.ustring().utf8().data()); @@ -51,12 +51,14 @@ void ScopeChainNode::print() const #endif -int ScopeChain::localDepth() const +const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0 }; + +int ScopeChainNode::localDepth() { int scopeDepth = 0; ScopeChainIterator iter = this->begin(); ScopeChainIterator end = this->end(); - while (!(*iter)->inherits(&JSActivation::info)) { + while (!(*iter)->inherits(&JSActivation::s_info)) { ++iter; if (iter == end) break; @@ -65,4 +67,13 @@ int ScopeChain::localDepth() const return scopeDepth; } +void ScopeChainNode::markChildren(MarkStack& markStack) +{ + if (next) + markStack.append(&next); + markStack.append(&object); + markStack.append(&globalObject); + markStack.append(&globalThis); +} + } // namespace JSC |