From 3a6401094f3bc5de4257f2bde6811ad83df1af88 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Wed, 25 Dec 2024 02:54:22 +0200 Subject: [PATCH] fix: don't omit stack trace elements without locations --- .../jscript/runtime/exceptions/EngineException.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java b/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java index 360a5a7..0800c0a 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java +++ b/src/main/java/me/topchetoeu/jscript/runtime/exceptions/EngineException.java @@ -21,6 +21,8 @@ public class EngineException extends RuntimeException { return ext == null || !ext.get(Value.HIDE_STACK, false); } public String toString() { + if (name == null && location == null) return "(skipped)"; + var res = ""; var loc = location; @@ -49,7 +51,7 @@ public class EngineException extends RuntimeException { public EngineException add(Environment env, String name, Location location) { var el = new StackElement(env, location, name); - if (el.name == null && el.location == null) return this; + // if (el.name == null && el.location == null) return this; setEnvironment(env); stackTrace.add(el); return this;