lojjic / PIE

A behavior for Internet Explorer allowing it to recognize and render various CSS3 box decoration properties
http://css3pie.com
Other
2.79k stars 235 forks source link

Avoid error in accessing window.PIE #273

Closed eric1234 closed 5 years ago

eric1234 commented 11 years ago

Occasionally I got an error when the cleanup function was run. Internet Explorer didn't actually indicate what the problem was. Just an error on that line. When I typed "window" into the console while the debugger was paused at the line I didn't get a problem. But when I typed "window.PIE" or "window['PIE']" I got the error again. So it is some problem in accessing the PIE object and even just testing for it's existence gives the error.

Found a [forum post][1] that suggested using a try/catch block. When I tried that the error went away.

Since the try/catch block will catch any error the check for printing didn't seem necessary anymore. So I just removed it.

[1] http://css3pie.com/forum/viewtopic.php?p=4765&sid=c961044763dea6c94d71cd790f52ad1b#p4765