예제 #1
0
JSValue* jsCSSPrimitiveValuePrototypeFunctionSetStringValue(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSCSSPrimitiveValue::s_info))
        return throwError(exec, TypeError);
    JSCSSPrimitiveValue* castedThisObj = static_cast<JSCSSPrimitiveValue*>(thisValue);
    CSSPrimitiveValue* imp = static_cast<CSSPrimitiveValue*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    unsigned short stringType = args[0]->toInt32(exec);
    const UString& stringValue = args[1]->toString(exec);

    imp->setStringValue(stringType, stringValue, ec);
    setDOMException(exec, ec);
    return jsUndefined();
}
JSValue JSC_HOST_CALL jsCSSPrimitiveValuePrototypeFunctionSetStringValue(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSCSSPrimitiveValue::s_info))
        return throwError(exec, TypeError);
    JSCSSPrimitiveValue* castedThisObj = static_cast<JSCSSPrimitiveValue*>(asObject(thisValue));
    CSSPrimitiveValue* imp = static_cast<CSSPrimitiveValue*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    unsigned short stringType = args.at(0).toInt32(exec);
    const UString& stringValue = args.at(1).toString(exec);

    imp->setStringValue(stringType, stringValue, ec);
    setDOMException(exec, ec);
    return jsUndefined();
}
static v8::Handle<v8::Value> setStringValueCallback(const v8::Arguments& args)
{
    CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    V8TRYCATCH(int, stringType, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, stringValue, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    imp->setStringValue(stringType, stringValue, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8Undefined();
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
예제 #4
0
static v8::Handle<v8::Value> setStringValueCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.CSSPrimitiveValue.setStringValue");
    CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
        EXCEPTION_BLOCK(int, stringType, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
        STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, stringValue, MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined));
        imp->setStringValue(stringType, stringValue, ec);
        if (UNLIKELY(ec))
            goto fail;
        return v8::Handle<v8::Value>();
    }
fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}