I am working on a Umbraco site that should work in large browsers, including IE 11, and I came across a strange problem that I can only replicate on IE 11.
At some point, the script for the TinyMCE plug-in attempts to execute this code (about four calls in depth) in response to the blur
event:
function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); }
and when trying to create a RegExp object, it throws an exception "The object does not support this action." cls
defined and has the expected value.
During a pause (using the Visual Studio debugger) in an unhandled exception, I made a small check.
It turns out that RegExp
was undefined
. I found this extremely strange.
A little more research has shown that ALL built-in objects were undefined. Number, Array, Object, Math ... all of them. In addition, although I could list global keys, all values ββwere also undefined.
In more scary mode, I could use console windows or immediate windows within the problem area to create regular expression objects using the /pattern/
syntax.
But this condition is true only in the scope of the event handler. As soon as the event handler exits, all built-in objects and values ββof global variables have been restored.
How can you even lose access to the built-in JavaScript objects without losing access to the main JavaScript parser and engine?
And, once lost, can they be restored?