public virtual object Compile(CompilerEnvirons compilerEnv, ScriptNode tree, string encodedSource, bool returnFunction)
{
int serial;
lock (globalLock)
{
serial = ++globalSerialClassCounter;
}
string baseName = "c";
if (tree.GetSourceName().Length > 0)
{
baseName = tree.GetSourceName().ReplaceAll("\\W", "_");
if (!char.IsJavaIdentifierStart(baseName[0]))
{
baseName = "_" + baseName;
}
}
string mainClassName = "org.mozilla.javascript.gen." + baseName + "_" + serial;
byte[] mainClassBytes = CompileToClassFile(compilerEnv, mainClassName, tree, encodedSource, returnFunction);
return new object[] { mainClassName, mainClassBytes };
}