зеркало из https://github.com/mozilla/gecko-dev.git
Bug 752223 - Implement JS_NumberValue(), replacing JS_NewNumberValue(). (r=luke)
This commit is contained in:
Родитель
2944580dce
Коммит
b0323e13a7
|
@ -5824,16 +5824,12 @@ DefineInterfaceConstants(JSContext *cx, JSObject *obj, const nsIID *aIID)
|
|||
}
|
||||
case nsXPTType::T_I32:
|
||||
{
|
||||
if (!JS_NewNumberValue(cx, c->GetValue()->val.i32, &v)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
v = JS_NumberValue(c->GetValue()->val.i32);
|
||||
break;
|
||||
}
|
||||
case nsXPTType::T_U32:
|
||||
{
|
||||
if (!JS_NewNumberValue(cx, c->GetValue()->val.u32, &v)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
v = JS_NumberValue(c->GetValue()->val.u32);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -2412,8 +2412,7 @@ nsJSContext::AddSupportsPrimitiveTojsvals(nsISupports *aArg, jsval *aArgv)
|
|||
|
||||
p->GetData(&data);
|
||||
|
||||
JSBool ok = ::JS_NewNumberValue(cx, data, aArgv);
|
||||
NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
|
||||
*aArgv = ::JS_NumberValue(data);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -2425,8 +2424,7 @@ nsJSContext::AddSupportsPrimitiveTojsvals(nsISupports *aArg, jsval *aArgv)
|
|||
|
||||
p->GetData(&data);
|
||||
|
||||
JSBool ok = ::JS_NewNumberValue(cx, data, aArgv);
|
||||
NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
|
||||
*aArgv = ::JS_NumberValue(data);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -2586,7 +2586,7 @@ if (!%(resultStr)s) {
|
|||
IDLType.Tags.double]:
|
||||
# XXXbz will cast to double do the "even significand" thing that webidl
|
||||
# calls for for 64-bit ints? Do we care?
|
||||
return wrapAndSetPtr("JS_NewNumberValue(cx, double(%s), ${jsvalPtr})" % result)
|
||||
return setValue("JS_NumberValue(double(%s))" % result)
|
||||
|
||||
elif tag == IDLType.Tags.uint32:
|
||||
return setValue("UINT_TO_JSVAL(%s)" % result)
|
||||
|
|
|
@ -50,12 +50,10 @@ ParseZoomRatioItemAndAdd(JSContext* aCx, JSObject* aArray, PRUint32 aIndex, cons
|
|||
}
|
||||
|
||||
double d = strtod(aStart, aEnd);
|
||||
jsval v;
|
||||
|
||||
d /= 100;
|
||||
if (!JS_NewNumberValue(aCx, d, &v)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
jsval v = JS_NumberValue(d);
|
||||
|
||||
if (!JS_SetElement(aCx, aArray, aIndex, &v)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -516,10 +516,9 @@ LockedFile::GetLocation(JSContext* aCx,
|
|||
if (mLocation == LL_MAXUINT) {
|
||||
*aLocation = JSVAL_NULL;
|
||||
}
|
||||
else if (!JS_NewNumberValue(aCx, double(mLocation), aLocation)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
else {
|
||||
*aLocation = JS_NumberValue(double(mLocation));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,17 +32,7 @@ MetadataHelper::GetSuccessResult(JSContext* aCx,
|
|||
NS_ENSURE_TRUE(obj, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
if (mParams->SizeRequested()) {
|
||||
jsval val;
|
||||
|
||||
if (mParams->Size() <= JSVAL_INT_MAX) {
|
||||
val = INT_TO_JSVAL(mParams->Size());
|
||||
}
|
||||
else {
|
||||
double size = mParams->Size();
|
||||
if (!JS_NewNumberValue(aCx, size, &val)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
jsval val = JS_NumberValue(mParams->Size());
|
||||
|
||||
if (!JS_DefineProperty(aCx, obj, "size", val, nullptr, nullptr,
|
||||
JSPROP_ENUMERATE)) {
|
||||
|
|
|
@ -119,8 +119,8 @@ IDBVersionChangeEvent::GetNewVersion(JSContext* aCx,
|
|||
if (!mNewVersion) {
|
||||
*aNewVersion = JSVAL_NULL;
|
||||
}
|
||||
else if (!JS_NewNumberValue(aCx, double(mNewVersion), aNewVersion)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
else {
|
||||
*aNewVersion = JS_NumberValue(double(mNewVersion));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -2324,11 +2324,7 @@ nsresult
|
|||
CountHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
{
|
||||
if (!JS_NewNumberValue(aCx, static_cast<double>(mCount), aVal)) {
|
||||
NS_WARNING("Failed to make number value!");
|
||||
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||
}
|
||||
|
||||
*aVal = JS_NumberValue(static_cast<double>(mCount));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -3653,11 +3653,7 @@ nsresult
|
|||
CountHelper::GetSuccessResult(JSContext* aCx,
|
||||
jsval* aVal)
|
||||
{
|
||||
if (!JS_NewNumberValue(aCx, static_cast<double>(mCount), aVal)) {
|
||||
NS_WARNING("Failed to make number value!");
|
||||
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||
}
|
||||
|
||||
*aVal = JS_NumberValue(static_cast<double>(mCount));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -362,21 +362,11 @@ NPVariantToJSVal(NPP npp, JSContext *cx, const NPVariant *variant)
|
|||
{
|
||||
// Don't use INT_TO_JSVAL directly to prevent bugs when dealing
|
||||
// with ints larger than what fits in a integer jsval.
|
||||
jsval val;
|
||||
if (::JS_NewNumberValue(cx, NPVARIANT_TO_INT32(*variant), &val)) {
|
||||
return val;
|
||||
}
|
||||
|
||||
break;
|
||||
return ::JS_NumberValue(NPVARIANT_TO_INT32(*variant));
|
||||
}
|
||||
case NPVariantType_Double :
|
||||
{
|
||||
jsval val;
|
||||
if (::JS_NewNumberValue(cx, NPVARIANT_TO_DOUBLE(*variant), &val)) {
|
||||
return val;
|
||||
}
|
||||
|
||||
break;
|
||||
return ::JS_NumberValue(NPVARIANT_TO_DOUBLE(*variant));
|
||||
}
|
||||
case NPVariantType_String :
|
||||
{
|
||||
|
|
|
@ -128,9 +128,7 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!JS_NewNumberValue(aCx, double(size), aVp.address())) {
|
||||
return false;
|
||||
}
|
||||
aVp.set(JS_NumberValue(double(size)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,8 @@ ObjectWrapperChild::jsval_from_JSVariant(JSContext* cx, const JSVariant& from,
|
|||
*to = INT_TO_JSVAL(from.get_int());
|
||||
return true;
|
||||
case JSVariant::Tdouble:
|
||||
return !!JS_NewNumberValue(cx, from.get_double(), to);
|
||||
*to = JS_NumberValue(from.get_double());
|
||||
return true;
|
||||
case JSVariant::Tbool:
|
||||
*to = BOOLEAN_TO_JSVAL(from.get_bool());
|
||||
return true;
|
||||
|
|
|
@ -270,7 +270,8 @@ ObjectWrapperParent::jsval_from_JSVariant(JSContext* cx, const JSVariant& from,
|
|||
*to = INT_TO_JSVAL(from.get_int());
|
||||
return true;
|
||||
case JSVariant::Tdouble:
|
||||
return !!JS_NewNumberValue(cx, from.get_double(), to);
|
||||
*to = JS_NumberValue(from.get_double());
|
||||
return true;
|
||||
case JSVariant::Tbool:
|
||||
*to = BOOLEAN_TO_JSVAL(from.get_bool());
|
||||
return true;
|
||||
|
|
|
@ -257,7 +257,8 @@ GCParameter(JSContext *cx, unsigned argc, jsval *vp)
|
|||
|
||||
if (argc == 1) {
|
||||
uint32_t value = JS_GetGCParameter(cx->runtime, param);
|
||||
return JS_NewNumberValue(cx, value, &vp[0]);
|
||||
vp[0] = JS_NumberValue(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (param == JSGC_NUMBER ||
|
||||
|
@ -632,7 +633,8 @@ CountHeap(JSContext *cx, unsigned argc, jsval *vp)
|
|||
return false;
|
||||
}
|
||||
|
||||
return JS_NewNumberValue(cx, (double) counter, vp);
|
||||
*vp = JS_NumberValue((double) counter);
|
||||
return true;
|
||||
}
|
||||
|
||||
static unsigned finalizeCount = 0;
|
||||
|
|
|
@ -1742,7 +1742,8 @@ SizeTojsval(JSContext* cx, size_t size, jsval* result)
|
|||
return false;
|
||||
}
|
||||
|
||||
return JS_NewNumberValue(cx, double(size), result);
|
||||
*result = JS_NumberValue(double(size));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Forcefully convert val to IntegerType when explicitly requested.
|
||||
|
@ -1905,9 +1906,9 @@ ConvertToJS(JSContext* cx,
|
|||
case TYPE_##name: { \
|
||||
type value = *static_cast<type*>(data); \
|
||||
if (sizeof(type) < 4) \
|
||||
*result = INT_TO_JSVAL(int32_t(value)); \
|
||||
else if (!JS_NewNumberValue(cx, double(value), result)) \
|
||||
return false; \
|
||||
*result = INT_TO_JSVAL(int32_t(value)); \
|
||||
else \
|
||||
*result = JS_NumberValue(double(value)); \
|
||||
break; \
|
||||
}
|
||||
#define DEFINE_WRAPPED_INT_TYPE(name, type, ffiType) \
|
||||
|
@ -1935,8 +1936,7 @@ ConvertToJS(JSContext* cx,
|
|||
#define DEFINE_FLOAT_TYPE(name, type, ffiType) \
|
||||
case TYPE_##name: { \
|
||||
type value = *static_cast<type*>(data); \
|
||||
if (!JS_NewNumberValue(cx, double(value), result)) \
|
||||
return false; \
|
||||
*result = JS_NumberValue(double(value)); \
|
||||
break; \
|
||||
}
|
||||
#define DEFINE_CHAR_TYPE(name, type, ffiType) \
|
||||
|
@ -7228,9 +7228,7 @@ Int64::Lo(JSContext* cx, unsigned argc, jsval* vp)
|
|||
int64_t u = Int64Base::GetInt(obj);
|
||||
double d = uint32_t(INT64_LO(u));
|
||||
|
||||
jsval result;
|
||||
if (!JS_NewNumberValue(cx, d, &result))
|
||||
return JS_FALSE;
|
||||
jsval result = JS_NumberValue(d);
|
||||
|
||||
JS_SET_RVAL(cx, vp, result);
|
||||
return JS_TRUE;
|
||||
|
@ -7250,9 +7248,7 @@ Int64::Hi(JSContext* cx, unsigned argc, jsval* vp)
|
|||
int64_t u = Int64Base::GetInt(obj);
|
||||
double d = int32_t(INT64_HI(u));
|
||||
|
||||
jsval result;
|
||||
if (!JS_NewNumberValue(cx, d, &result))
|
||||
return JS_FALSE;
|
||||
jsval result = JS_NumberValue(d);
|
||||
|
||||
JS_SET_RVAL(cx, vp, result);
|
||||
return JS_TRUE;
|
||||
|
@ -7400,9 +7396,7 @@ UInt64::Lo(JSContext* cx, unsigned argc, jsval* vp)
|
|||
uint64_t u = Int64Base::GetInt(obj);
|
||||
double d = uint32_t(INT64_LO(u));
|
||||
|
||||
jsval result;
|
||||
if (!JS_NewNumberValue(cx, d, &result))
|
||||
return JS_FALSE;
|
||||
jsval result = JS_NumberValue(d);
|
||||
|
||||
JS_SET_RVAL(cx, vp, result);
|
||||
return JS_TRUE;
|
||||
|
@ -7422,9 +7416,7 @@ UInt64::Hi(JSContext* cx, unsigned argc, jsval* vp)
|
|||
uint64_t u = Int64Base::GetInt(obj);
|
||||
double d = uint32_t(INT64_HI(u));
|
||||
|
||||
jsval result;
|
||||
if (!JS_NewNumberValue(cx, d, &result))
|
||||
return JS_FALSE;
|
||||
jsval result = JS_NumberValue(d);
|
||||
|
||||
JS_SET_RVAL(cx, vp, result);
|
||||
return JS_TRUE;
|
||||
|
|
|
@ -13,8 +13,10 @@
|
|||
static JSBool
|
||||
my_convert(JSContext* context, JS::HandleObject obj, JSType type, JS::MutableHandleValue rval)
|
||||
{
|
||||
if (type == JSTYPE_VOID || type == JSTYPE_STRING || type == JSTYPE_NUMBER || type == JSTYPE_BOOLEAN)
|
||||
return JS_NewNumberValue(context, 123, rval.address());
|
||||
if (type == JSTYPE_VOID || type == JSTYPE_STRING || type == JSTYPE_NUMBER || type == JSTYPE_BOOLEAN) {
|
||||
rval.set(JS_NumberValue(123));
|
||||
return JS_TRUE;
|
||||
}
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -2366,15 +2366,6 @@ JS_strdup(JSContext *cx, const char *s)
|
|||
return (char *)js_memcpy(p, s, n);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_NewNumberValue(JSContext *cx, double d, jsval *rval)
|
||||
{
|
||||
AssertHeapIsIdle(cx);
|
||||
d = JS_CANONICALIZE_NAN(d);
|
||||
rval->setNumber(d);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
#undef JS_AddRoot
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
|
|
|
@ -2242,6 +2242,16 @@ JSVAL_TO_PRIVATE(jsval v)
|
|||
return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));
|
||||
}
|
||||
|
||||
static JS_ALWAYS_INLINE jsval
|
||||
JS_NumberValue(double d)
|
||||
{
|
||||
int32_t i;
|
||||
d = JS_CANONICALIZE_NAN(d);
|
||||
if (MOZ_DOUBLE_IS_INT32(d, &i))
|
||||
return INT_TO_JSVAL(i);
|
||||
return DOUBLE_TO_JSVAL(d);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -3475,8 +3485,6 @@ JS_updateMallocCounter(JSContext *cx, size_t nbytes);
|
|||
extern JS_PUBLIC_API(char *)
|
||||
JS_strdup(JSContext *cx, const char *s);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_NewNumberValue(JSContext *cx, double d, jsval *rval);
|
||||
|
||||
/*
|
||||
* A GC root is a pointer to a jsval, JSObject * or JSString * that itself
|
||||
|
|
|
@ -25,7 +25,8 @@ static PerfMeasurement* GetPMFromThis(JSContext* cx, jsval* vp);
|
|||
PerfMeasurement* p = GetPM(cx, obj, #name); \
|
||||
if (!p) \
|
||||
return JS_FALSE; \
|
||||
return JS_NewNumberValue(cx, double(p->name), vp.address()); \
|
||||
vp.set(JS_NumberValue(double(p->name))); \
|
||||
return JS_TRUE; \
|
||||
}
|
||||
|
||||
GETTER(cpu_cycles)
|
||||
|
|
|
@ -2181,10 +2181,8 @@ ZZ_formatter(JSContext *cx, const char *format, bool fromJS, jsval **vpp,
|
|||
} else {
|
||||
re = va_arg(ap, double);
|
||||
im = va_arg(ap, double);
|
||||
if (!JS_NewNumberValue(cx, re, &vp[0]))
|
||||
return false;
|
||||
if (!JS_NewNumberValue(cx, im, &vp[1]))
|
||||
return false;
|
||||
vp[0] = JS_NumberValue(re);
|
||||
vp[1] = JS_NumberValue(im);
|
||||
}
|
||||
*vpp = vp + 2;
|
||||
*app = ap;
|
||||
|
@ -2394,7 +2392,8 @@ ToInt32(JSContext *cx, unsigned argc, jsval *vp)
|
|||
|
||||
if (!JS_ValueToInt32(cx, argc == 0 ? JSVAL_VOID : vp[2], &i))
|
||||
return false;
|
||||
return JS_NewNumberValue(cx, i, vp);
|
||||
*vp = JS_NumberValue(i);
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
@ -2665,7 +2664,8 @@ ShapeOf(JSContext *cx, unsigned argc, JS::Value *vp)
|
|||
return false;
|
||||
}
|
||||
JSObject *obj = &v.toObject();
|
||||
return JS_NewNumberValue(cx, (double) ((uintptr_t)obj->lastProperty() >> 3), vp);
|
||||
*vp = JS_NumberValue((double) ((uintptr_t)obj->lastProperty() >> 3));
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3059,8 +3059,10 @@ SetTimeoutValue(JSContext *cx, double t)
|
|||
static JSBool
|
||||
Timeout(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
if (argc == 0)
|
||||
return JS_NewNumberValue(cx, gTimeoutInterval, vp);
|
||||
if (argc == 0) {
|
||||
*vp = JS_NumberValue(gTimeoutInterval);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
JS_ReportError(cx, "Wrong number of arguments");
|
||||
|
@ -3083,7 +3085,8 @@ Elapsed(JSContext *cx, unsigned argc, jsval *vp)
|
|||
JSShellContextData *data = GetContextData(cx);
|
||||
if (data)
|
||||
d = PRMJ_Now() - data->startTime;
|
||||
return JS_NewNumberValue(cx, d, vp);
|
||||
*vp = JS_NumberValue(d);
|
||||
return true;
|
||||
}
|
||||
JS_ReportError(cx, "Wrong number of arguments");
|
||||
return false;
|
||||
|
|
|
@ -1401,11 +1401,10 @@ nsXPCComponents_Results::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
|||
nsresult rv;
|
||||
while (nsXPCException::IterateNSResults(&rv, &rv_name, nullptr, &iter)) {
|
||||
if (!strcmp(name.ptr(), rv_name)) {
|
||||
jsval val;
|
||||
jsval val = JS_NumberValue((double)rv);
|
||||
|
||||
*objp = obj;
|
||||
if (!JS_NewNumberValue(cx, (double)rv, &val) ||
|
||||
!JS_DefinePropertyById(cx, obj, id, val,
|
||||
if (!JS_DefinePropertyById(cx, obj, id, val,
|
||||
nullptr, nullptr,
|
||||
JSPROP_ENUMERATE |
|
||||
JSPROP_READONLY |
|
||||
|
@ -4691,8 +4690,7 @@ nsXPCComponents::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|||
|
||||
nsresult rv = NS_OK;
|
||||
if (doResult) {
|
||||
if (!JS_NewNumberValue(cx, (double) res, vp))
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
*vp = JS_NumberValue((double) res);
|
||||
rv = NS_SUCCESS_I_DID_SOMETHING;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,13 +122,15 @@ xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, J
|
|||
inline JSBool
|
||||
xpc_qsInt64ToJsval(JSContext *cx, PRInt64 i, jsval *rv)
|
||||
{
|
||||
return JS_NewNumberValue(cx, static_cast<double>(i), rv);
|
||||
*rv = JS_NumberValue(static_cast<double>(i));
|
||||
return true;
|
||||
}
|
||||
|
||||
inline JSBool
|
||||
xpc_qsUint64ToJsval(JSContext *cx, PRUint64 u, jsval *rv)
|
||||
{
|
||||
return JS_NewNumberValue(cx, static_cast<double>(u), rv);
|
||||
*rv = JS_NumberValue(static_cast<double>(u));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -449,7 +449,8 @@ XPCVariant::VariantDataToJS(XPCLazyCallContext& lccx,
|
|||
// Easy. Handle inline.
|
||||
if (NS_FAILED(variant->GetAsDouble(&xpctvar.val.d)))
|
||||
return false;
|
||||
return JS_NewNumberValue(cx, xpctvar.val.d, pJSVal);
|
||||
*pJSVal = JS_NumberValue(xpctvar.val.d);
|
||||
return true;
|
||||
}
|
||||
case nsIDataType::VTYPE_BOOL:
|
||||
{
|
||||
|
|
|
@ -332,10 +332,12 @@ resultConvTemplates = {
|
|||
" return xpc_qsUint64ToJsval(cx, result, ${jsvalPtr});\n",
|
||||
|
||||
'float':
|
||||
" return JS_NewNumberValue(cx, result, ${jsvalPtr});\n",
|
||||
" ${jsvalRef} = JS_NumberValue(result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'double':
|
||||
" return JS_NewNumberValue(cx, result, ${jsvalPtr});\n",
|
||||
" ${jsvalRef} = JS_NumberValue(result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'boolean':
|
||||
" ${jsvalRef} = (result ? JSVAL_TRUE : JSVAL_FALSE);\n"
|
||||
|
|
|
@ -656,10 +656,12 @@ resultConvTemplates = {
|
|||
" return xpc_qsUint64ToJsval(cx, result, ${jsvalPtr});\n",
|
||||
|
||||
'float':
|
||||
" return JS_NewNumberValue(cx, result, ${jsvalPtr});\n",
|
||||
" ${jsvalRef} = JS_NumberValue(result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'double':
|
||||
" return JS_NewNumberValue(cx, result, ${jsvalPtr});\n",
|
||||
" ${jsvalRef} = JS_NumberValue(result);\n"
|
||||
" return JS_TRUE;\n",
|
||||
|
||||
'boolean':
|
||||
" ${jsvalRef} = (result ? JSVAL_TRUE : JSVAL_FALSE);\n"
|
||||
|
|
|
@ -66,10 +66,7 @@ StatementRow::GetProperty(nsIXPConnectWrappedNative *aWrapper,
|
|||
double dval;
|
||||
rv = mStatement->GetDouble(idx, &dval);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!::JS_NewNumberValue(aCtx, dval, _vp)) {
|
||||
*_retval = false;
|
||||
return NS_OK;
|
||||
}
|
||||
*_vp = ::JS_NumberValue(dval);
|
||||
}
|
||||
else if (type == mozIStorageValueArray::VALUE_TYPE_TEXT) {
|
||||
PRUint32 bytes;
|
||||
|
|
Загрузка…
Ссылка в новой задаче