EncodedJSValue jsDOMPluginConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName) { JSDOMPlugin* domObject = jsDynamicCast<JSDOMPlugin*>(JSValue::decode(thisValue)); if (!domObject) return throwVMTypeError(exec); if (!domObject) return throwVMTypeError(exec); return JSValue::encode(JSDOMPlugin::getConstructor(exec->vm(), domObject->globalObject())); }
EncodedJSValue JSC_HOST_CALL jsDOMPluginPrototypeFunctionNamedItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSDOMPlugin* castedThis = jsDynamicCast<JSDOMPlugin*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMPlugin::info()); DOMPlugin& impl = castedThis->impl(); const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.namedItem(name))); return JSValue::encode(result); }
EncodedJSValue JSC_HOST_CALL jsDOMPluginPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSDOMPlugin* castedThis = jsDynamicCast<JSDOMPlugin*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMPlugin::info()); DOMPlugin& impl = castedThis->impl(); 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 JSDOMPlugin::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName) { JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>(slotBase); return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)))); }
EncodedJSValue JSDOMPlugin::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index) { JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>(JSValue::decode(slotBase)); ASSERT_GC_OBJECT_INHERITS(thisObj, info()); return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index))); }