Пример #1
0
void JSSVGStringListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSSVGStringList* jsSVGStringList = jsCast<JSSVGStringList*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsSVGStringList->impl(), jsSVGStringList);
    jsSVGStringList->releaseImpl();
}
Пример #2
0
EncodedJSValue jsSVGStringListConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSSVGStringList* domObject = jsDynamicCast<JSSVGStringList*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSSVGStringList::getConstructor(exec->vm(), domObject->globalObject()));
}
Пример #3
0
EncodedJSValue jsSVGStringListNumberOfItems(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    JSValue result =  jsNumber(castedThis->impl().numberOfItems());
    return JSValue::encode(result);
}
Пример #4
0
EncodedJSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionClear(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSSVGStringList::info());
    SVGStaticListPropertyTearOff<SVGStringList> & impl = castedThis->impl();
    ExceptionCode ec = 0;
    impl.clear(ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}
Пример #5
0
JSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionAppendItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSSVGStringList::s_info))
        return throwError(exec, TypeError);
    JSSVGStringList* castedThisObj = static_cast<JSSVGStringList*>(asObject(thisValue));
    SVGStringList* imp = static_cast<SVGStringList*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    const UString& item = args.at(0).toString(exec);


    JSC::JSValue result = jsString(exec, imp->appendItem(item, ec));
    setDOMException(exec, ec);
    return result;
}
Пример #6
0
EncodedJSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionAppendItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSSVGStringList::info());
    SVGStaticListPropertyTearOff<SVGStringList> & impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    const String& item(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = jsStringWithCache(exec, impl.appendItem(item, ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
Пример #7
0
EncodedJSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionRemoveItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSSVGStringList::info());
    SVGStaticListPropertyTearOff<SVGStringList> & impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = jsStringWithCache(exec, impl.removeItem(index, ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}