Changeset 10168 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Aug 12, 2005, 4:20:48 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r10148 r10168 334 334 ValueImp *ResolveNode::evaluate(ExecState *exec) 335 335 { 336 ScopeChain chain = exec->context().imp()->scopeChain(); 337 338 assert(!chain.isEmpty()); 336 const ScopeChain& chain = exec->context().imp()->scopeChain(); 337 ScopeChainIterator iter = chain.begin(); 338 ScopeChainIterator end = chain.end(); 339 340 // we must always have something in the scope chain 341 assert(iter != end); 339 342 340 343 PropertySlot slot; 341 344 do { 342 ObjectImp *o = chain.top();345 ObjectImp *o = *iter; 343 346 344 347 if (o->getPropertySlot(exec, ident, slot)) 345 348 return slot.getValue(exec, ident); 346 349 347 chain.pop();348 } while ( !chain.isEmpty());350 ++iter; 351 } while (iter != end); 349 352 350 353 return undefinedVariableError(exec, ident); … … 353 356 Reference ResolveNode::evaluateReference(ExecState *exec) 354 357 { 355 ScopeChain chain = exec->context().imp()->scopeChain(); 356 357 assert(!chain.isEmpty()); 358 const ScopeChain& chain = exec->context().imp()->scopeChain(); 359 ScopeChainIterator iter = chain.begin(); 360 ScopeChainIterator end = chain.end(); 361 362 // we must always have something in the scope chain 363 assert(iter != end); 358 364 359 365 PropertySlot slot; 360 366 do { 361 ObjectImp *o = chain.top();367 ObjectImp *o = *iter; 362 368 if (o->getPropertySlot(exec, ident, slot)) 363 369 return Reference(o, ident); 364 370 365 chain.pop();366 } while ( !chain.isEmpty());371 ++iter; 372 } while (iter != end); 367 373 368 374 return Reference(ident); … … 818 824 ValueImp *FunctionCallResolveNode::evaluate(ExecState *exec) 819 825 { 820 ScopeChain chain = exec->context().imp()->scopeChain(); 821 822 assert(!chain.isEmpty()); 826 const ScopeChain& chain = exec->context().imp()->scopeChain(); 827 ScopeChainIterator iter = chain.begin(); 828 ScopeChainIterator end = chain.end(); 829 830 // we must always have something in the scope chain 831 assert(iter != end); 823 832 824 833 PropertySlot slot; 825 834 ObjectImp *base; 826 835 do { 827 base = chain.top();836 base = *iter; 828 837 if (base->getPropertySlot(exec, ident, slot)) { 829 838 ValueImp *v = slot.getValue(exec, ident); … … 855 864 return func->call(exec, thisObj, argList); 856 865 } 857 chain.pop();858 } while ( !chain.isEmpty());866 ++iter; 867 } while (iter != end); 859 868 860 869 return undefinedVariableError(exec, ident); … … 1680 1689 ValueImp *AssignResolveNode::evaluate(ExecState *exec) 1681 1690 { 1682 ScopeChain chain = exec->context().imp()->scopeChain(); 1683 1684 assert(!chain.isEmpty()); 1691 const ScopeChain& chain = exec->context().imp()->scopeChain(); 1692 ScopeChainIterator iter = chain.begin(); 1693 ScopeChainIterator end = chain.end(); 1694 1695 // we must always have something in the scope chain 1696 assert(iter != end); 1685 1697 1686 1698 PropertySlot slot; 1687 1699 ObjectImp *base; 1688 1700 do { 1689 base = chain.top();1701 base = *iter; 1690 1702 if (base->getPropertySlot(exec, m_ident, slot)) 1691 1703 goto found; 1692 1704 1693 chain.pop();1694 } while ( !chain.isEmpty());1705 ++iter; 1706 } while (iter != end); 1695 1707 1696 1708 if (m_oper != OpEqual)
Note:
See TracChangeset
for help on using the changeset viewer.