EncodedJSValue jsNodeListConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName) { JSNodeList* domObject = jsDynamicCast<JSNodeList*>(JSValue::decode(thisValue)); if (!domObject) return throwVMTypeError(exec); if (!domObject) return throwVMTypeError(exec); return JSValue::encode(JSNodeList::getConstructor(exec->vm(), domObject->globalObject())); }
EncodedJSValue JSC_HOST_CALL jsNodeListPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSNodeList* castedThis = jsDynamicCast<JSNodeList*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSNodeList::info()); NodeList& 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); }
JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName) { JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase)); return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyNameToAtomicString(propertyName))); }
EncodedJSValue JSNodeList::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index) { JSNodeList* thisObj = jsCast<JSNodeList*>(JSValue::decode(slotBase)); ASSERT_GC_OBJECT_INHERITS(thisObj, info()); return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index))); }