Changeset 9889 in webkit for trunk/JavaScriptCore/kjs/function.cpp
- Timestamp:
- Jul 25, 2005, 3:17:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function.cpp
r9768 r9889 203 203 } 204 204 205 Value FunctionImp::get(ExecState *exec, const Identifier &propertyName) const205 bool FunctionImp::getOwnProperty(ExecState *exec, const Identifier& propertyName, Value& result) const 206 206 { 207 207 // Find the arguments from the closest context. … … 209 209 ContextImp *context = exec->_context; 210 210 while (context) { 211 if (context->function() == this) 212 return static_cast<ActivationImp *> 213 (context->activationObject())->get(exec, propertyName); 214 context = context->callingContext(); 211 if (context->function() == this) { 212 result = static_cast<ActivationImp *>(context->activationObject())->get(exec, propertyName); 213 return true; 214 } 215 context = context->callingContext(); 215 216 } 216 return Null(); 217 result = Null(); 218 return true; 217 219 } 218 220 … … 225 227 p = p->next; 226 228 } 227 return Number(count); 229 result = Number(count); 230 return true; 228 231 } 229 232 230 return InternalFunctionImp::get (exec, propertyName);233 return InternalFunctionImp::getOwnProperty(exec, propertyName, result); 231 234 } 232 235 … … 441 444 } 442 445 443 Value ArgumentsImp::get(ExecState *exec, const Identifier &propertyName) const446 bool ArgumentsImp::getOwnProperty(ExecState *exec, const Identifier& propertyName, Value& result) const 444 447 { 445 448 if (indexToNameMap.isMapped(propertyName)) { 446 return _activationObject->get(exec, indexToNameMap[propertyName]); 447 } else { 448 return ObjectImp::get(exec, propertyName); 449 } 449 result = _activationObject->get(exec, indexToNameMap[propertyName]); 450 return true; 451 } 452 453 return ObjectImp::getOwnProperty(exec, propertyName, result); 450 454 } 451 455 … … 489 493 } 490 494 491 Value ActivationImp::get(ExecState *exec, const Identifier &propertyName) const 492 { 495 bool ActivationImp::getOwnProperty(ExecState *exec, const Identifier& propertyName, Value& result) const 496 { 497 // do this first so property map arguments property wins over the below 498 if (ObjectImp::getOwnProperty(exec, propertyName, result)) 499 return true; 500 493 501 if (propertyName == argumentsPropertyName) { 494 // check for locally declared arguments property495 ValueImp *v = getDirect(propertyName);496 if (v)497 return Value(v);498 499 502 // default: return builtin arguments array 500 503 if (!_argumentsObject) 501 createArgumentsObject(exec); 502 return Value(_argumentsObject); 503 } 504 return ObjectImp::get(exec, propertyName); 504 createArgumentsObject(exec); 505 506 result = Value(_argumentsObject); 507 return true; 508 } 509 510 return false; 505 511 } 506 512
Note:
See TracChangeset
for help on using the changeset viewer.