From 3d5be60fc71819062e7b728278b43fddd603ea5e Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:22:58 +0200 Subject: [PATCH] feat: honor passed set in toReadableLines --- .../topchetoeu/jscript/runtime/values/objects/ObjectValue.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java b/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java index 0895859..a52497d 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java +++ b/src/main/java/me/topchetoeu/jscript/runtime/values/objects/ObjectValue.java @@ -316,6 +316,7 @@ public class ObjectValue extends Value { return res; } @Override public List toReadableLines(Environment env, HashSet passed) { + if (passed.contains(this)) return Arrays.asList("[circular]"); return toReadableLines(env, passed, new HashSet<>()); }