fix: symbols not stringified properly

This commit is contained in:
TopchetoEU 2024-12-09 22:15:51 +02:00
parent 611be55bbb
commit 28679f44d5
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -1,6 +1,9 @@
package me.topchetoeu.jscript.runtime.values.primitives; package me.topchetoeu.jscript.runtime.values.primitives;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import me.topchetoeu.jscript.common.environment.Environment; import me.topchetoeu.jscript.common.environment.Environment;
import me.topchetoeu.jscript.runtime.exceptions.EngineException; import me.topchetoeu.jscript.runtime.exceptions.EngineException;
@ -34,6 +37,11 @@ public final class SymbolValue extends PrimitiveValue {
else return "Symbol(" + value + ")"; else return "Symbol(" + value + ")";
} }
@Override
public List<String> toReadableLines(Environment env, HashSet<ObjectValue> passed) {
return Arrays.asList(toString());
}
public SymbolValue(String value) { public SymbolValue(String value) {
this.value = value; this.value = value;
} }