Skip to content

Instantly share code, notes, and snippets.

@JohanObrink
Last active December 18, 2015 14:19
Show Gist options
  • Select an option

  • Save JohanObrink/5796334 to your computer and use it in GitHub Desktop.

Select an option

Save JohanObrink/5796334 to your computer and use it in GitHub Desktop.

Revisions

  1. JohanObrink revised this gist Jun 17, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -2,16 +2,16 @@
    if(navigator.appVersion.indexOf('MSIE 8') > 0) {
    var _slice = Array.prototype.slice;
    Array.prototype.slice = function() {
    if('object' === typeof this) {
    if(this instanceof Array) {
    return _slice.apply(this, arguments);
    } else {
    var result = [];
    var start = (arguments.length >= 1) ? arguments[0] : 0;
    var end = (arguments.length >= 2) ? arguments[1] : this.length;
    for(var i=start; i<end; i++) {
    result.push(this[i]);
    }
    return result;
    } else {
    return _slice.apply(this, arguments);
    }
    };
    }
  2. JohanObrink created this gist Jun 17, 2013.
    18 changes: 18 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    (function() {
    if(navigator.appVersion.indexOf('MSIE 8') > 0) {
    var _slice = Array.prototype.slice;
    Array.prototype.slice = function() {
    if('object' === typeof this) {
    var result = [];
    var start = (arguments.length >= 1) ? arguments[0] : 0;
    var end = (arguments.length >= 2) ? arguments[1] : this.length;
    for(var i=start; i<end; i++) {
    result.push(this[i]);
    }
    return result;
    } else {
    return _slice.apply(this, arguments);
    }
    };
    }
    })();