Bug 1339406 - Part 6: Block-scope helper variables from ecma_6/Math/shell.js. r=arai
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 14 Feb 2017 10:26:21 -0800
changeset 342914 8de9955bf06203b53da9a1ff4d780af21b6aefb6
parent 342913 c5f655086e0cf6ab05ad63f81f36cf8ef40325f4
child 342915 9a7b08f075ac93c59484cb0613453979add5a8e2
push id31366
push usercbook@mozilla.com
push dateWed, 15 Feb 2017 11:25:19 +0000
treeherdermozilla-central@c0807d6938c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1339406
milestone54.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 1339406 - Part 6: Block-scope helper variables from ecma_6/Math/shell.js. r=arai
js/src/tests/ecma_6/Math/shell.js
--- a/js/src/tests/ecma_6/Math/shell.js
+++ b/js/src/tests/ecma_6/Math/shell.js
@@ -1,14 +1,14 @@
 // The nearest representable values to +1.0.
 const ONE_PLUS_EPSILON = 1 + Math.pow(2, -52);  // 0.9999999999999999
 const ONE_MINUS_EPSILON = 1 - Math.pow(2, -53);  // 1.0000000000000002
 
 {
-    var fail = function (msg) {
+    const fail = function (msg) {
         var exc = new Error(msg);
         try {
             // Try to improve on exc.fileName and .lineNumber; leave exc.stack
             // alone. We skip two frames: fail() and its caller, an assertX()
             // function.
             var frames = exc.stack.trim().split("\n");
             if (frames.length > 2) {
                 var m = /@([^@:]*):([0-9]+)$/.exec(frames[2]);
@@ -16,31 +16,31 @@ const ONE_MINUS_EPSILON = 1 - Math.pow(2
                     exc.fileName = m[1];
                     exc.lineNumber = +m[2];
                 }
             }
         } catch (ignore) { throw ignore;}
         throw exc;
     };
 
-    var ENDIAN;  // 0 for little-endian, 1 for big-endian.
+    let ENDIAN;  // 0 for little-endian, 1 for big-endian.
 
     // Return the difference between the IEEE 754 bit-patterns for a and b.
     //
     // This is meaningful when a and b are both finite and have the same
     // sign. Then the following hold:
     //
     //   * If a === b, then diff(a, b) === 0.
     //
     //   * If a !== b, then diff(a, b) === 1 + the number of representable values
     //                                         between a and b.
     //
-    var f = new Float64Array([0, 0]);
-    var u = new Uint32Array(f.buffer);
-    var diff = function (a, b) {
+    const f = new Float64Array([0, 0]);
+    const u = new Uint32Array(f.buffer);
+    const diff = function (a, b) {
         f[0] = a;
         f[1] = b;
         //print(u[1].toString(16) + u[0].toString(16) + " " + u[3].toString(16) + u[2].toString(16));
         return Math.abs((u[3-ENDIAN] - u[1-ENDIAN]) * 0x100000000 + u[2+ENDIAN] - u[0+ENDIAN]);
     };
 
     // Set ENDIAN to the platform's endianness.
     ENDIAN = 0;  // try little-endian first