Changeset 30534 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Feb 23, 2008, 9:01:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r30492 r30534 3569 3569 if (base->getPropertySlot(exec, m_ident, slot)) 3570 3570 break; 3571 3572 3571 ++iter; 3573 3572 } while (iter != end); 3574 3573 3575 unsigned flags = 0; 3576 base->getPropertyAttributes(m_ident, flags); 3577 flags |= ReadOnly; 3578 3579 base->put(exec, m_ident, val, flags); 3574 ASSERT(base->isActivationObject() || base->isGlobalObject()); 3575 3576 static_cast<JSVariableObject*>(base)->initializeVariable(exec, m_ident, val, ReadOnly); 3580 3577 } 3581 3578 … … 3585 3582 ASSERT(exec->variableObject()->hasOwnProperty(exec, m_ident) || exec->codeType() == EvalCode); // Guaranteed by processDeclarations. 3586 3583 const ScopeChain& chain = exec->scopeChain(); 3587 JS Object* variableObject = exec->variableObject();3584 JSVariableObject* variableObject = exec->variableObject(); 3588 3585 3589 3586 ASSERT(!chain.isEmpty()); … … 3594 3591 if (inGlobalScope) { 3595 3592 JSValue* val = m_init->evaluate(exec); 3596 int flags = Internal;3593 unsigned attributes = ReadOnly; 3597 3594 if (exec->codeType() != EvalCode) 3598 flags |= DontDelete; 3599 flags |= ReadOnly; 3600 variableObject->put(exec, m_ident, val, flags); 3595 attributes |= DontDelete; 3596 variableObject->initializeVariable(exec, m_ident, val, attributes); 3601 3597 } else { 3602 3598 JSValue* val = m_init->evaluate(exec); … … 3609 3605 return handleSlowCase(exec, chain, val); 3610 3606 3611 unsigned flags = 0; 3612 variableObject->getPropertyAttributes(m_ident, flags); 3613 flags |= ReadOnly; 3614 3615 variableObject->put(exec, m_ident, val, flags); 3607 variableObject->initializeVariable(exec, m_ident, val, ReadOnly); 3616 3608 } 3617 3609 } … … 4304 4296 if (m_catchBlock && exec->completionType() == Throw) { 4305 4297 JSObject* obj = new JSObject; 4306 obj->put (exec,m_exceptionIdent, result, DontDelete);4298 obj->putDirect(m_exceptionIdent, result, DontDelete); 4307 4299 exec->dynamicGlobalObject()->tearOffActivation(exec); 4308 4300 exec->pushScope(obj); … … 4486 4478 localStorage.reserveCapacity(totalSize); 4487 4479 4488 int minAttributes = Internal |DontDelete;4480 int minAttributes = DontDelete; 4489 4481 4490 4482 // In order for our localStorage indexes to be correct, we must match the … … 4533 4525 localStorage.reserveCapacity(localStorage.size() + m_varStack.size() + m_functionStack.size()); 4534 4526 4535 int minAttributes = Internal |DontDelete;4527 int minAttributes = DontDelete; 4536 4528 4537 4529 // In order for our localStorage indexes to be correct, we must match the … … 4578 4570 JSVariableObject* variableObject = exec->variableObject(); 4579 4571 4580 int minAttributes = Internal;4581 4582 4572 for (i = 0, size = m_varStack.size(); i < size; ++i) { 4583 4573 Identifier& ident = m_varStack[i].first; 4584 4574 if (variableObject->hasProperty(exec, ident)) 4585 4575 continue; 4586 int attributes = minAttributes;4576 int attributes = 0; 4587 4577 if (m_varStack[i].second & DeclarationStacks::IsConstant) 4588 attributes |= ReadOnly;4589 variableObject-> put(exec, ident, jsUndefined(), attributes);4578 attributes = ReadOnly; 4579 variableObject->initializeVariable(exec, ident, jsUndefined(), attributes); 4590 4580 } 4591 4581 4592 4582 for (i = 0, size = m_functionStack.size(); i < size; ++i) { 4593 FuncDeclNode* node= m_functionStack[i];4594 variableObject-> put(exec, node->m_ident, node->makeFunction(exec), minAttributes);4583 FuncDeclNode* funcDecl = m_functionStack[i]; 4584 variableObject->initializeVariable(exec, funcDecl->m_ident, funcDecl->makeFunction(exec), 0); 4595 4585 } 4596 4586 } … … 4671 4661 JSObject* proto = exec->lexicalGlobalObject()->objectConstructor()->construct(exec, exec->emptyList()); 4672 4662 proto->putDirect(exec->propertyNames().constructor, func, DontEnum); 4673 func->putDirect(exec->propertyNames().prototype, proto, Internal |DontDelete);4663 func->putDirect(exec->propertyNames().prototype, proto, DontDelete); 4674 4664 func->putDirect(exec->propertyNames().length, jsNumber(m_body->parameters().size()), ReadOnly | DontDelete | DontEnum); 4675 4665 return func; … … 4708 4698 JSObject* proto = exec->lexicalGlobalObject()->objectConstructor()->construct(exec, exec->emptyList()); 4709 4699 proto->putDirect(exec->propertyNames().constructor, func, DontEnum); 4710 func->putDirect(exec->propertyNames().prototype, proto, Internal |DontDelete);4700 func->putDirect(exec->propertyNames().prototype, proto, DontDelete); 4711 4701 4712 4702 if (named) { 4713 functionScopeObject->putDirect(m_ident, func, Internal |ReadOnly | (exec->codeType() == EvalCode ? 0 : DontDelete));4703 functionScopeObject->putDirect(m_ident, func, ReadOnly | (exec->codeType() == EvalCode ? 0 : DontDelete)); 4714 4704 exec->popScope(); 4715 4705 }
Note:
See TracChangeset
for help on using the changeset viewer.