2020import com .laytonsmith .core .exceptions .CRE .CREStackOverflowError ;
2121import com .laytonsmith .core .exceptions .ConfigCompileException ;
2222import com .laytonsmith .core .exceptions .ConfigRuntimeException ;
23+ import com .laytonsmith .core .exceptions .StackTraceFrame ;
2324import com .laytonsmith .core .exceptions .StackTraceManager ;
2425import com .laytonsmith .core .exceptions .UnhandledFlowControlException ;
2526import com .laytonsmith .core .functions .ControlFlow ;
@@ -198,7 +199,7 @@ public Mixed execute(List<Mixed> args, Environment oldEnv, Target t) {
198199
199200 Script fakeScript = Script .GenerateScript (tree , env .getEnv (GlobalEnv .class ).GetLabel (), null );
200201 StackTraceManager stManager = env .getEnv (GlobalEnv .class ).GetStackTraceManager ();
201- stManager .addStackTraceElement (new ConfigRuntimeException . StackTraceElement ("proc " + name , getTarget ()));
202+ stManager .addStackTraceFrame (new StackTraceFrame ("proc " + name , getTarget ()));
202203 try {
203204 Mixed result = fakeScript .eval (tree , env );
204205 if (result == null ) {
@@ -223,7 +224,7 @@ public Mixed execute(List<Mixed> args, Environment oldEnv, Target t) {
223224 } catch (StackOverflowError e ) {
224225 throw new CREStackOverflowError (null , t , e );
225226 } finally {
226- stManager .popStackTraceElement ();
227+ stManager .popStackTraceFrame ();
227228 }
228229 }
229230
@@ -261,8 +262,8 @@ public void definitelyNotConstant() {
261262 public Callable .PreparedCallable prepareCall (List <Mixed > args , Environment callerEnv , Target callTarget ) {
262263 Environment env = prepareEnvironment (args , callerEnv , callTarget );
263264 StackTraceManager stManager = env .getEnv (GlobalEnv .class ).GetStackTraceManager ();
264- stManager .addStackTraceElement (
265- new ConfigRuntimeException . StackTraceElement ("proc " + name , getTarget ()));
265+ stManager .addStackTraceFrame (
266+ new StackTraceFrame ("proc " + name , getTarget ()));
266267 return new Callable .PreparedCallable (tree , env );
267268 }
268269
@@ -469,14 +470,14 @@ private StepAction startBody(Environment callerEnv) {
469470 bodyStarted = true ;
470471 procEnv = prepareEnvironment (evaluatedArgs , callerEnv , callTarget );
471472 StackTraceManager stManager = procEnv .getEnv (GlobalEnv .class ).GetStackTraceManager ();
472- stManager .addStackTraceElement (
473- new ConfigRuntimeException . StackTraceElement ("proc " + name , getTarget ()));
473+ stManager .addStackTraceFrame (
474+ new StackTraceFrame ("proc " + name , getTarget ()));
474475 return new StepAction .Evaluate (tree , procEnv );
475476 }
476477
477478 private void popStackTrace () {
478479 if (procEnv != null ) {
479- procEnv .getEnv (GlobalEnv .class ).GetStackTraceManager ().popStackTraceElement ();
480+ procEnv .getEnv (GlobalEnv .class ).GetStackTraceManager ().popStackTraceFrame ();
480481 }
481482 }
482483 }
0 commit comments