EncodedJSValue jsFileListConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName) { JSFileList* domObject = jsDynamicCast<JSFileList*>(JSValue::decode(thisValue)); if (!domObject) return throwVMTypeError(exec); if (!domObject) return throwVMTypeError(exec); return JSValue::encode(JSFileList::getConstructor(exec->vm(), domObject->globalObject())); }
EncodedJSValue JSC_HOST_CALL jsFileListPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSFileList* castedThis = jsDynamicCast<JSFileList*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSFileList::info()); FileList& impl = castedThis->impl(); if (exec->argumentCount() < 1) return throwVMError(exec, createNotEnoughArgumentsError(exec)); unsigned index(toUInt32(exec, exec->argument(0), NormalConversion)); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index))); return JSValue::encode(result); }
EncodedJSValue JSFileList::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index) { JSFileList* thisObj = jsCast<JSFileList*>(JSValue::decode(slotBase)); ASSERT_GC_OBJECT_INHERITS(thisObj, info()); return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index))); }