Changeset 24533 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Jul 23, 2007, 1:48:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r24532 r24533 1619 1619 JSValue* VarDeclNode::evaluate(ExecState* exec) 1620 1620 { 1621 JSValue* val; 1621 const ScopeChain& chain = exec->context()->scopeChain(); 1622 JSObject* variableObject = exec->context()->variableObject(); 1623 1624 ASSERT(!chain.isEmpty()); 1625 1622 1626 if (init) { 1623 val = init->evaluate(exec);1627 JSValue* val = init->evaluate(exec); 1624 1628 KJS_CHECKEXCEPTIONVALUE 1625 1629 1626 const ScopeChain& chain = exec->context()->scopeChain();1627 JSObject* variableObject = exec->context()->variableObject();1628 1629 ASSERT(!chain.isEmpty());1630 ASSERT(variableObject->getDirect(ident) || ident == exec->propertyNames().arguments);1631 1632 1630 // if the variable object is the top of the scope chain, then that must 1633 1631 // be where this variable is declared, processVarDecls would have put … … 1641 1639 flags |= ReadOnly; 1642 1640 1643 variableObject->put(exec, ident, val, flags); 1644 } 1641 if (++chain.begin() == chain.end()) { 1642 int flags = Internal; 1643 if (exec->context()->codeType() != EvalCode) 1644 flags |= DontDelete; 1645 if (varType == VarDeclNode::Constant) 1646 flags |= ReadOnly; 1647 variableObject->putDirect(ident, val, flags); 1648 } else { 1649 ASSERT(variableObject->getDirect(ident) || ident == exec->propertyNames().arguments); 1650 variableObject->put(exec, ident, val, flags); 1651 } 1652 } else { 1653 if (++chain.begin() == chain.end()) { 1654 int flags = Internal; 1655 if (exec->context()->codeType() != EvalCode) 1656 flags |= DontDelete; 1657 if (varType == VarDeclNode::Constant) 1658 flags |= ReadOnly; 1659 variableObject->putDirect(ident, jsUndefined(), flags); 1660 } else { 1661 1662 } 1663 } 1645 1664 1646 1665 // no caller of this function actually uses the return value.
Note:
See TracChangeset
for help on using the changeset viewer.