I'm using Crystal Reports in ASP.NET webforms to show some report files. The framework generates some javascript that which is used for the UI logic.
Un-minified version (using a beautifier): http://pastebin.com/uryjRZF7
The thing that bothers me is that as soon as I do any modification to the array prototype, the script above throws 2 errors. It looks like this in firebug (yes, I know, but I can't un-minify it at this point):
TypeError: E[D].getHTML is not a function
...conWidget("iconMenu_icon_"+C,B,IconMenuWidget_iconClickCB,K,F,J,G,P,L,A,N,false)...
TypeError: A.layer is null
...conWidget("iconMenu_icon_"+C,B,IconMenuWidget_iconClickCB,K,F,J,G,P,L,A,N,false)...
For example, this would make the errors appear:
if(!Array.prototype.somethingVeryUnique) {
Array.prototype.somethingVeryUnique = function () {
return this.length;
};
}
How can this possibly interfer with the auto generated file?!
Update:
Object.defineProperty(Array.prototype, "somethingUnique", {
enumerable: false,
writable: true,
value: function () {
}
});
If I make it non-enumerable, it works. However, object.defineProperty
doesn't work in IE7, which I need to support.
Is there any way to make a non-enumerable property without it?