Q:

Simple JSON object throws "Object doesn't support this property or method"

I've written a small framework for asynchronous resource loading (link). In most modern browsers like Opera, Chrome, Firefox it is working as expected.
I've also tried it in IE8, but the code doesn't execute. IE throws "Object doesn't support this property or method" on a simple well-formed [ checked via eval() ] JSON object.
How can I fix this or what causes this error?

A:

Probably the error is raised because IE8 does not support .indexOf().
Ref:

indexOf was added to the ECMA-262 standard in the 5th edition; as such
  it may not be present in all browsers. You can work around this by
  utilizing the following code at the beginning of your scripts. This
  will allow you to use indexOf when there is still no native support.
  This algorithm matches the one specified in ECMA-262, 5th edition,
  assuming TypeError and Math.abs have their original values.

Using the polyfill code:
if (!Array.prototype.indexOf) {
  Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
    "use strict";
    if (this == null) {
      throw new TypeError();
    }
    var t = Object(this);
    var len = t.length >>> 0;

    if (len === 0) {
      return -1;
    }
    var n = 0;
    if (arguments.length > 1) {
      n = Number(arguments[1]);
      if (n != n) { // shortcut for verifying if it's NaN
        n = 0;
      } else if (n != 0 && n != Infinity && n != -Infinity) {
        n = (n > 0 || -1) * Math.floor(Math.abs(n));
      }
    }
    if (n >= len) {
      return -1;
    }
    var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
    for (; k < len; k++) {
      if (k in t && t[k] === searchElement) {
        return k;
      }
    }
    return -1;
  }
}

