Bug 1528792 - Remove redundant code checking for Symbol values in js::ToNumberSlow. r=tcampbell
authorJason Orendorff <jorendorff@mozilla.com>
Tue, 12 Mar 2019 15:17:09 +0000
changeset 524595 3a1ed20749c52c026c16d1a374a53cf7b92799b2
parent 524594 7a1ad6647c22bd34a6c70e67dc26e5b83f71cea4
child 524596 d7f58753a9812c7e3c239af7b9d633198fe43c19
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1528792
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528792 - Remove redundant code checking for Symbol values in js::ToNumberSlow. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D23152
js/src/jsnum.cpp
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1666,23 +1666,16 @@ JS_PUBLIC_API bool js::ToNumberSlow(JSCo
   if (v.isBoolean()) {
     *out = v.toBoolean() ? 1.0 : 0.0;
     return true;
   }
   if (v.isNull()) {
     *out = 0.0;
     return true;
   }
-  if (v.isSymbol()) {
-    if (!cx->helperThread()) {
-      JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
-                                JSMSG_SYMBOL_TO_NUMBER);
-    }
-    return false;
-  }
 
   if (v.isUndefined()) {
     *out = GenericNaN();
     return true;
   }
 
   MOZ_ASSERT(v.isSymbol() || v.isBigInt());
   if (!cx->helperThread()) {