In this snippet from Polyfill's "typedarray.js", I'm getting an error @ the below commented portion
(function() {
var orig = Object.defineProperty;
var dom_only = !(function(){
try{
return Object.defineProperty({},'x',{});
} catch(_) {
return false;
}
}());
if (!orig || dom_only) {
Object.defineProperty = function (o, prop, desc) {
// In IE8 try built-in implementation for defining properties on DOM prototypes.
if (orig)
try {
return orig(o, prop, desc);
} catch (_) {} //<--here throws "Object does not support this action"
if (o !== Object(o))
throw TypeError('Object.defineProperty called on non-object');
if (Object.prototype.__defineGetter__ && ('get' in desc))
Object.prototype.__defineGetter__.call(o, prop, desc.get);
if (Object.prototype.__defineSetter__ && ('set' in desc))
Object.prototype.__defineSetter__.call(o, prop, desc.set);
if ('value' in desc)
o[prop] = desc.value;
return o;
};
}
}());
It only throws this error when I'm in IE8. Can anyone provide some clarification as to why? I've looked at other questions similar to this but it is not making sense to me. I'm a fairly new web developer, if that might help you formulate a response.