I've designed some functions which call alert() and confirm().
I use Jint to test those functions.
However, Jint doesn't support alert() and confirm().
What I'd like to do is create a wrapper around alert() and confirm() which checks if running in Jint context:
function MyAlert()
{
if(Jint != true) alert();
}
How do I tell if I'm in Jint context?
Thanks, Ed
Rather than environment detection, I'd suggest feature detection:
* or
=== "function"
, but some older browsers (like IE8, still sadly in significant-though-diminishing use) report built-ins likealert
as"object"
.