Wrap restoring of the original optimization level into finally block

git-svn-id: svn://10.0.0.236/trunk@134407 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
igor%mir2.org
2002-11-25 16:46:16 +00:00
parent bcb7c1ff89
commit 5c23c40494

View File

@@ -512,9 +512,12 @@ public class NativeGlobal implements IdFunctionMaster {
// mode.
int oldOptLevel = cx.getOptimizationLevel();
cx.setOptimizationLevel(-1);
Script script = cx.compileReader(scope, in, sourceName, 1,
null);
cx.setOptimizationLevel(oldOptLevel);
Script script;
try {
script = cx.compileReader(scope, in, sourceName, 1, null);
} finally {
cx.setOptimizationLevel(oldOptLevel);
}
// if the compile fails, an error has been reported by the
// compiler, but we need to stop execution to avoid