Adding a utility function to detect the Rhino shell.

This commit is contained in:
pschwartau%netscape.com 2002-04-10 22:39:16 +00:00
parent 5c2244951b
commit 23d222431f
2 changed files with 32 additions and 0 deletions

View File

@ -51,6 +51,22 @@ function inSection(x)
}
/*
* Some tests need to know if we are in Rhino as opposed to SpiderMonkey
*/
function inRhino()
{
try
{
java;
return true;
}
catch(e)
{
return false;
}
}
/*
* Report a failure in the 'accepted' manner
*/

View File

@ -51,6 +51,22 @@ function inSection(x)
}
/*
* Some tests need to know if we are in Rhino as opposed to SpiderMonkey
*/
function inRhino()
{
try
{
java;
return true;
}
catch(e)
{
return false;
}
}
/*
* Report a failure in the 'accepted' manner
*/