コード例 #1
0
JSValue* jsCSSPrimitiveValuePrototypeFunctionGetCounterValue(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;


    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->getCounterValue(ec)));
    setDOMException(exec, ec);
    return result;
}
static v8::Handle<v8::Value> getCounterValueCallback(const v8::Arguments& args)
{
    CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    RefPtr<Counter> result = imp->getCounterValue(ec);
    if (UNLIKELY(ec))
        goto fail;
    return toV8(result.release(), args.Holder(), args.GetIsolate());
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
JSValue JSC_HOST_CALL jsCSSPrimitiveValuePrototypeFunctionGetCounterValue(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;


    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getCounterValue(ec)));
    setDOMException(exec, ec);
    return result;
}
コード例 #4
0
static v8::Handle<v8::Value> getCounterValueCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.CSSPrimitiveValue.getCounterValue");
    CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
        RefPtr<Counter> result = imp->getCounterValue(ec);
        if (UNLIKELY(ec))
            goto fail;
        return toV8(result.release());
    }
fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}