Changeset 24287 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Jul 14, 2007, 10:04:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r21790 r24287 4 4 * Copyright (C) 2001 Peter Kelly ([email protected]) 5 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 * Copyright (C) 2007 Cameron Zwarich ([email protected]) 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 1596 1597 val = init->evaluate(exec); 1597 1598 KJS_CHECKEXCEPTIONVALUE 1598 } else { 1599 1600 if (variable->getDirect(ident) || ident == exec->propertyNames().arguments) { 1601 const ScopeChain& chain = exec->context()->scopeChain(); 1602 ScopeChainIterator iter = chain.begin(); 1603 ScopeChainIterator end = chain.end(); 1604 1605 // we must always have something in the scope chain 1606 ASSERT(iter != end); 1607 1608 PropertySlot slot; 1609 JSObject* base; 1610 1611 do { 1612 base = *iter; 1613 if (base->getPropertySlot(exec, ident, slot)) 1614 break; 1615 1616 ++iter; 1617 } while (iter != end); 1618 1619 unsigned flags = 0; 1620 base->getPropertyAttributes(ident, flags); 1621 if (varType == VarDeclNode::Constant) 1622 flags |= ReadOnly; 1623 1624 base->put(exec, ident, val, flags); 1625 return jsString(ident.ustring()); 1626 } 1627 } else { 1599 1628 // already declared? - check with getDirect so you can override 1600 1629 // built-in properties of the global object with var declarations.
Note:
See TracChangeset
for help on using the changeset viewer.