From 61c81de8aadaea7c0d50206835b3e3964292a24c Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Sun, 6 Jul 2014 08:08:38 -0400 Subject: [PATCH] Update es5-shim to latest master (40181d720e07) Includes a fix for . 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/es5-shim/es5-shim.js b/resources/lib/es5-shim/es5-shim.js index 02048c0a50..d20aa1b45b 100644 --- a/resources/lib/es5-shim/es5-shim.js +++ b/resources/lib/es5-shim/es5-shim.js @@ -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" ); -- 2.20.1