Bug 1410067 - Changed use of 2^62 to Number.MAX_SAFE_INTEGER (represents 2^53 - 1) to avoid faulty behavior. r=mikedeboer
authorNicole Byer <nicole_byer@alumni.brown.edu>
Tue, 24 Oct 2017 13:58:55 -0300
changeset 388180 44a2659e778a
parent 388179 05eeb1a900b2
child 388181 a8526281637d
push id96571
push userryanvm@gmail.com
push dateWed, 25 Oct 2017 18:27:59 +0000
treeherdermozilla-inbound@44a2659e778a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1410067
milestone58.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 1410067 - Changed use of 2^62 to Number.MAX_SAFE_INTEGER (represents 2^53 - 1) to avoid faulty behavior. r=mikedeboer
browser/components/sessionstore/SessionCookies.jsm
--- a/browser/components/sessionstore/SessionCookies.jsm
+++ b/browser/components/sessionstore/SessionCookies.jsm
@@ -12,18 +12,17 @@ const Ci = Components.interfaces;
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "Utils",
   "resource://gre/modules/sessionstore/Utils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivacyLevel",
   "resource://gre/modules/sessionstore/PrivacyLevel.jsm");
 
-// MAX_EXPIRY should be 2^63-1, but JavaScript can't handle that precision.
-const MAX_EXPIRY = Math.pow(2, 62);
+const MAX_EXPIRY = Number.MAX_SAFE_INTEGER;
 
 /**
  * The external API implemented by the SessionCookies module.
  */
 this.SessionCookies = Object.freeze({
   collect() {
     return SessionCookiesInternal.collect();
   },