Changeset 35022 in webkit for trunk/JavaScriptCore/kjs/Arguments.cpp
- Timestamp:
- Jul 5, 2008, 10:26:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/Arguments.cpp
r35018 r35022 36 36 37 37 // ECMA 10.1.8 38 Arguments::Arguments(ExecState* exec, JSFunction* func , const ArgList& args, JSActivation* act)38 Arguments::Arguments(ExecState* exec, JSFunction* function, const ArgList& args, JSActivation* activation) 39 39 : JSObject(exec->lexicalGlobalObject()->objectPrototype()) 40 , _activationObject(act)41 , indexToNameMap(func, args)40 , m_activationObject(activation) 41 , m_indexToNameMap(function, args) 42 42 { 43 putDirect(exec->propertyNames().callee, func , DontEnum);43 putDirect(exec->propertyNames().callee, function, DontEnum); 44 44 putDirect(exec, exec->propertyNames().length, args.size(), DontEnum); 45 45 … … 48 48 for (ArgList::const_iterator it = args.begin(); it != end; ++it, ++i) { 49 49 Identifier name = Identifier::from(exec, i); 50 if (! indexToNameMap.isMapped(name))50 if (!m_indexToNameMap.isMapped(name)) 51 51 putDirect(name, *it, DontEnum); 52 52 } … … 55 55 void Arguments::mark() 56 56 { 57 JSObject::mark();58 if (_activationObject && !_activationObject->marked())59 _activationObject->mark();57 JSObject::mark(); 58 if (m_activationObject && !m_activationObject->marked()) 59 m_activationObject->mark(); 60 60 } 61 61 62 62 JSValue* Arguments::mappedIndexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot) 63 63 { 64 Arguments* thisObj = static_cast<Arguments*>(slot.slotBase());65 return thisObj->_activationObject->get(exec, thisObj->indexToNameMap[propertyName]);64 Arguments* thisObj = static_cast<Arguments*>(slot.slotBase()); 65 return thisObj->m_activationObject->get(exec, thisObj->m_indexToNameMap[propertyName]); 66 66 } 67 67 68 68 bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 69 69 { 70 if (indexToNameMap.isMapped(propertyName)) {71 slot.setCustom(this, mappedIndexGetter);72 return true;73 }70 if (m_indexToNameMap.isMapped(propertyName)) { 71 slot.setCustom(this, mappedIndexGetter); 72 return true; 73 } 74 74 75 return JSObject::getOwnPropertySlot(exec, propertyName, slot);75 return JSObject::getOwnPropertySlot(exec, propertyName, slot); 76 76 } 77 77 78 78 void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 79 79 { 80 if ( indexToNameMap.isMapped(propertyName))81 _activationObject->put(exec,indexToNameMap[propertyName], value);80 if (m_indexToNameMap.isMapped(propertyName)) 81 m_activationObject->put(exec, m_indexToNameMap[propertyName], value); 82 82 else 83 83 JSObject::put(exec, propertyName, value); … … 86 86 bool Arguments::deleteProperty(ExecState* exec, const Identifier& propertyName) 87 87 { 88 if (indexToNameMap.isMapped(propertyName)) { 89 indexToNameMap.unMap(exec, propertyName); 90 return true; 91 } else { 88 if (m_indexToNameMap.isMapped(propertyName)) { 89 m_indexToNameMap.unMap(exec, propertyName); 90 return true; 91 } 92 92 93 return JSObject::deleteProperty(exec, propertyName); 93 }94 94 } 95 95
Note:
See TracChangeset
for help on using the changeset viewer.