Changeset 158793 in webkit for trunk/Source/JavaScriptCore/runtime/Arguments.cpp
- Timestamp:
- Nov 6, 2013, 2:37:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r156984 r158793 28 28 #include "CallFrameInlines.h" 29 29 #include "JSActivation.h" 30 #include "JSArgumentsIterator.h" 30 31 #include "JSFunction.h" 31 32 #include "JSGlobalObject.h" … … 51 52 visitor.append(&thisObject->m_activation); 52 53 } 54 55 static EncodedJSValue JSC_HOST_CALL argumentsFuncIterator(ExecState*); 53 56 54 57 void Arguments::destroy(JSCell* cell) … … 152 155 thisObject->createStrictModeCallerIfNecessary(exec); 153 156 154 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 157 if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 158 return true; 159 if (propertyName == exec->propertyNames().iteratorPrivateName) { 160 VM& vm = exec->vm(); 161 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 162 thisObject->JSC_NATIVE_FUNCTION(exec->propertyNames().iteratorPrivateName, argumentsFuncIterator, DontEnum, 0); 163 if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 164 return true; 165 } 166 return false; 155 167 } 156 168 … … 362 374 } 363 375 } 376 377 EncodedJSValue JSC_HOST_CALL argumentsFuncIterator(ExecState* exec) 378 { 379 JSObject* thisObj = exec->hostThisValue().toThis(exec, StrictMode).toObject(exec); 380 Arguments* arguments = jsDynamicCast<Arguments*>(thisObj); 381 if (!arguments) 382 return JSValue::encode(throwTypeError(exec, "Attempted to use Arguments iterator on non-Arguments object")); 383 return JSValue::encode(JSArgumentsIterator::create(exec->vm(), exec->callee()->globalObject()->argumentsIteratorStructure(), arguments)); 384 } 385 364 386 365 387 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.