IE8 getPrototypeOf method
dojo, internet-explorer, javascript
Solution
Jon Resig's polyfill works http://ejohn.org/blog/objectgetprototypeof/
I have made it even smaller
if (typeof Object.getPrototypeOf !== "function")
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
Problem
Pretty simple: I have code using `Object.getPrototypeOf(...)` to get the inherited classes of a Dojo Widget (just a JS object). `Object.getPrototypeOf(...)` isn't supported in IE8. I need an IE work around. Any ideas? Thanks in advance.