Update es5-shim to latest master (40181d720e07)
authorKevin Israel <pleasestand@live.com>
Sun, 6 Jul 2014 12:08:38 +0000 (08:08 -0400)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 10 Jul 2014 17:38:33 +0000 (19:38 +0200)
Includes a fix for <https://github.com/es-shims/es5-shim/issues/253>.
The bug makes es5-shim unusable in the browsers we are most interested
in using it for: old versions of IE.

Source code:
 https://github.com/es-shims/es5-shim/blob/40181d720e/es5-shim.js

Bug: 67565
Change-Id: Iee964bea6fcc1071871e457643b77ffd452e1040

resources/lib/es5-shim/es5-shim.js

index 02048c0..d20aa1b 100644 (file)
@@ -674,7 +674,7 @@ defineProperties(ArrayPrototype, {
 // ES5 15.4.4.14
 // http://es5.github.com/#x15.4.4.14
 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
-var hasFirefox2IndexOfBug = [0, 1].indexOf(1, 2) !== -1;
+var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
 defineProperties(ArrayPrototype, {
     indexOf: function indexOf(sought /*, fromIndex */ ) {
         var self = splitString && isString(this) ? this.split('') : toObject(this),
@@ -703,7 +703,7 @@ defineProperties(ArrayPrototype, {
 // ES5 15.4.4.15
 // http://es5.github.com/#x15.4.4.15
 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
-var hasFirefox2LastIndexOfBug = [0, 1].lastIndexOf(0, -3) !== -1;
+var hasFirefox2LastIndexOfBug = Array.prototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
 defineProperties(ArrayPrototype, {
     lastIndexOf: function lastIndexOf(sought /*, fromIndex */) {
         var self = splitString && isString(this) ? this.split('') : toObject(this),
@@ -1082,7 +1082,7 @@ if (!Date.now) {
 // http://es5.github.com/#x15.7.4.5
 var hasToFixedBugs = NumberPrototype.toFixed && (
   (0.00008).toFixed(3) !== '0.000'
-  || (0.9).toFixed(0) === '0'
+  || (0.9).toFixed(0) !== '1'
   || (1.255).toFixed(2) !== '1.25'
   || (1000000000000000128).toFixed(0) !== "1000000000000000128"
 );