[tor-commits] [tor-browser] 11/15: Bug 1776658: Update some setNumber callers. r=jandem, a=RyanVM

gitolite role git at cupani.torproject.org
Thu Aug 18 22:31:53 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.13.0esr-11.5-1
in repository tor-browser.

commit c53997d1e1ddf8db4b636db8108650d0b3f2de7d
Author: Kris Maglione <maglione.k at gmail.com>
AuthorDate: Wed Aug 3 19:55:31 2022 +0000

    Bug 1776658: Update some setNumber callers. r=jandem, a=RyanVM
    
    Differential Revision: https://phabricator.services.mozilla.com/D152822
---
 dom/bindings/ToJSValue.h        | 2 +-
 dom/indexedDB/KeyPath.cpp       | 2 +-
 js/xpconnect/src/XPCConvert.cpp | 2 +-
 js/xpconnect/src/XPCVariant.cpp | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dom/bindings/ToJSValue.h b/dom/bindings/ToJSValue.h
index 3a4097b19e2a5..7aec1689bff57 100644
--- a/dom/bindings/ToJSValue.h
+++ b/dom/bindings/ToJSValue.h
@@ -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;
 }
 
diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp
index 3d04a805cc59c..b24c57a3cf753 100644
--- a/dom/indexedDB/KeyPath.cpp
+++ b/dom/indexedDB/KeyPath.cpp
@@ -84,7 +84,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;
       }
 
diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp
index c6c145d760a48..e0e1759cea8be 100644
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -106,7 +106,7 @@ bool XPCConvert::NativeData2JS(JSContext* cx, MutableHandleValue d,
       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));
diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp
index 67dd0e770514d..2671fbbb76ac9 100644
--- a/js/xpconnect/src/XPCVariant.cpp
+++ b/js/xpconnect/src/XPCVariant.cpp
@@ -438,7 +438,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: {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list