From 58c3d520dc09237e8037202b3f68638a01721aaf Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 10 Jul 2014 22:44:32 +0200 Subject: [PATCH] Upgrade e5-shim to v4.0.0 Source code: https://github.com/es-shims/es5-shim/blob/v4.0.0/es5-shim.js Follows-up 61c81de, dcdca49, and ea307ea. Notable changes; * Removes breaking polyfill for Array#splice https://github.com/es-shims/es5-shim/issues/255 Change-Id: Id1bf4b5f35fed05817f77e087cd489aed719ecd5 --- RELEASE-NOTES-1.24 | 1 + resources/lib/es5-shim/es5-shim.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index ec31355f41..f4acc374a4 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -110,6 +110,7 @@ production. * Upgrade Moment.js to v2.7.0. * (bug 67042) Added support for the HTML5 tag for East Asian typography. * Upgrade Sinon.JS to 1.10.3. +* Added the es5-shim polyfill for older or non-compliant javascript engines. === Bug fixes in 1.24 === * (bug 49116) Footer copyright notice is now always displayed in user language diff --git a/resources/lib/es5-shim/es5-shim.js b/resources/lib/es5-shim/es5-shim.js index d20aa1b45b..4595994058 100644 --- a/resources/lib/es5-shim/es5-shim.js +++ b/resources/lib/es5-shim/es5-shim.js @@ -366,7 +366,6 @@ var spliceWorksWithEmptyObject = (function () { ArrayPrototype.splice.call(obj, 0, 0, 1); return obj.length === 1; }()); -var omittingSecondSpliceArgIsNoop = [1].splice(0).length === 0; defineProperties(ArrayPrototype, { splice: function splice(start, deleteCount) { if (arguments.length === 0) { return []; } @@ -375,14 +374,14 @@ defineProperties(ArrayPrototype, { if (arguments.length > 0 && typeof deleteCount !== 'number') { args = _Array_slice_.call(arguments); if (args.length < 2) { - args.push(toInteger(deleteCount)); + args.push(this.length - start); } else { args[1] = toInteger(deleteCount); } } return array_splice.apply(this, args); } -}, !omittingSecondSpliceArgIsNoop || !spliceWorksWithEmptyObject); +}, !spliceWorksWithEmptyObject); // ES5 15.4.4.12 // http://es5.github.com/#x15.4.4.13 -- 2.20.1