зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1776658: Update some setNumber callers. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D152822
This commit is contained in:
Родитель
7ac4427e01
Коммит
372e3c54a2
|
@ -117,7 +117,7 @@ inline bool ToJSValue(JSContext* aCx, double aArgument,
|
|||
// Make sure we're called in a compartment
|
||||
MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
|
||||
|
||||
aValue.setNumber(aArgument);
|
||||
aValue.set(JS_NumberValue(aArgument));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ nsresult GetJSValFromKeyPathString(
|
|||
// step 4 substep 1: check for .length on a String value.
|
||||
if (currentVal.isString() && !tokenizer.hasMoreTokens() &&
|
||||
token.EqualsLiteral("length")) {
|
||||
aKeyJSVal->setNumber(double(JS_GetStringLength(currentVal.toString())));
|
||||
aKeyJSVal->setNumber(JS_GetStringLength(currentVal.toString()));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ bool XPCConvert::NativeData2JS(JSContext* cx, MutableHandleValue d,
|
|||
d.setInt32(*static_cast<const int32_t*>(s));
|
||||
return true;
|
||||
case nsXPTType::T_I64:
|
||||
d.setNumber(static_cast<double>(*static_cast<const int64_t*>(s)));
|
||||
d.setNumber(*static_cast<const int64_t*>(s));
|
||||
return true;
|
||||
case nsXPTType::T_U8:
|
||||
d.setInt32(*static_cast<const uint8_t*>(s));
|
||||
|
@ -98,13 +98,13 @@ bool XPCConvert::NativeData2JS(JSContext* cx, MutableHandleValue d,
|
|||
d.setNumber(*static_cast<const uint32_t*>(s));
|
||||
return true;
|
||||
case nsXPTType::T_U64:
|
||||
d.setNumber(static_cast<double>(*static_cast<const uint64_t*>(s)));
|
||||
d.setNumber(*static_cast<const uint64_t*>(s));
|
||||
return true;
|
||||
case nsXPTType::T_FLOAT:
|
||||
d.setNumber(*static_cast<const float*>(s));
|
||||
return true;
|
||||
case nsXPTType::T_DOUBLE:
|
||||
d.setNumber(*static_cast<const double*>(s));
|
||||
d.set(JS_NumberValue(*static_cast<const double*>(s)));
|
||||
return true;
|
||||
case nsXPTType::T_BOOL:
|
||||
d.setBoolean(*static_cast<const bool*>(s));
|
||||
|
|
|
@ -439,7 +439,7 @@ bool XPCVariant::VariantDataToJS(JSContext* cx, nsIVariant* variant,
|
|||
if (NS_FAILED(variant->GetAsDouble(&d))) {
|
||||
return false;
|
||||
}
|
||||
pJSVal.setNumber(d);
|
||||
pJSVal.set(JS_NumberValue(d));
|
||||
return true;
|
||||
}
|
||||
case nsIDataType::VTYPE_BOOL: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче