JSValue* jsCSSPrimitiveValuePrototypeFunctionSetFloatValue(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 unitType = args[0]->toInt32(exec); float floatValue = args[1]->toFloat(exec); imp->setFloatValue(unitType, floatValue, ec); setDOMException(exec, ec); return jsUndefined(); }
static v8::Handle<v8::Value> setFloatValueCallback(const v8::Arguments& args) { CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder()); ExceptionCode ec = 0; { V8TRYCATCH(int, unitType, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))); V8TRYCATCH(float, floatValue, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue())); imp->setFloatValue(unitType, floatValue, ec); if (UNLIKELY(ec)) goto fail; return v8Undefined(); } fail: return setDOMException(ec, args.GetIsolate()); }
static v8::Handle<v8::Value> setFloatValueCallback(const v8::Arguments& args) { INC_STATS("DOM.CSSPrimitiveValue.setFloatValue"); CSSPrimitiveValue* imp = V8CSSPrimitiveValue::toNative(args.Holder()); ExceptionCode ec = 0; { EXCEPTION_BLOCK(int, unitType, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))); EXCEPTION_BLOCK(float, floatValue, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)->NumberValue())); imp->setFloatValue(unitType, floatValue, ec); if (UNLIKELY(ec)) goto fail; return v8::Handle<v8::Value>(); } fail: V8Proxy::setDOMException(ec); return v8::Handle<v8::Value>(); }