Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokenizer breaks IE 8 and older - Quick fix #33

Open
oddpixel opened this issue Dec 18, 2015 · 1 comment
Open

Tokenizer breaks IE 8 and older - Quick fix #33

oddpixel opened this issue Dec 18, 2015 · 1 comment

Comments

@oddpixel
Copy link

This plugin seems to break on IE 8 and older because Array.filter is not supported and will give you an error.

https://github.com/saabi/vminpoly/blob/master/tokenizer.js#L501

A quick way to fix this yourself is to include the following snippet:

if (!Array.prototype.filter)
{
  Array.prototype.filter = function(fun /*, thisp */)
  {
    "use strict";

    if (this === void 0 || this === null)
      throw new TypeError();

    var t = Object(this);
    var len = t.length >>> 0;
    if (typeof fun !== "function")
      throw new TypeError();

    var res = [];
    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in t)
      {
        var val = t[i]; // in case fun mutates this
        if (fun.call(thisp, val, i, t))
          res.push(val);
      }
    }

    return res;
  };
}
@ghost
Copy link

ghost commented Mar 12, 2016

I cannot seem to reproduce the error you are having with native IE 8.0.7601.17514 on a Windows 7 Ultimate 64 SP1 box. Just checked the demo and everything works 100% spot on here. Not checked on lower or higher versions IE but 8.0.7601.17514 works fine from looking at the demo and resizing the viewport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant