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 521597 3a1ed20749c5
parent 521596 7a1ad6647c22
child 521598 d7f58753a981
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [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()) {