refactor: move debugging logic out of core

This commit is contained in:
TopchetoEU 2024-01-10 17:01:24 +02:00
parent d1937fdb63
commit 8156a1733f
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
16 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.utils.mapping;
package me.topchetoeu.jscript.common;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,5 +0,0 @@
package me.topchetoeu.jscript.core.engine.debug;
public interface Debugger extends DebugHandler, DebugController {
void close();
}

View File

@ -8,21 +8,17 @@ import java.nio.file.Path;
import me.topchetoeu.jscript.common.Filename;
import me.topchetoeu.jscript.common.Metadata;
import me.topchetoeu.jscript.common.Reading;
import me.topchetoeu.jscript.core.engine.Context;
import me.topchetoeu.jscript.core.engine.Engine;
import me.topchetoeu.jscript.core.engine.Environment;
import me.topchetoeu.jscript.core.engine.debug.DebugContext;
import me.topchetoeu.jscript.core.engine.debug.DebugServer;
import me.topchetoeu.jscript.core.engine.debug.SimpleDebugger;
import me.topchetoeu.jscript.core.engine.values.ArrayValue;
import me.topchetoeu.jscript.core.engine.values.NativeFunction;
import me.topchetoeu.jscript.core.engine.values.ObjectValue;
import me.topchetoeu.jscript.core.engine.values.Values;
import me.topchetoeu.jscript.core.exceptions.EngineException;
import me.topchetoeu.jscript.core.exceptions.InterruptException;
import me.topchetoeu.jscript.core.exceptions.SyntaxException;
import me.topchetoeu.jscript.lib.EnvironmentLib;
import me.topchetoeu.jscript.lib.Internals;
import me.topchetoeu.jscript.utils.debug.DebugServer;
import me.topchetoeu.jscript.utils.debug.SimpleDebugger;
import me.topchetoeu.jscript.utils.filesystem.Filesystem;
import me.topchetoeu.jscript.utils.filesystem.MemoryFilesystem;
import me.topchetoeu.jscript.utils.filesystem.Mode;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.io.IOException;
import java.io.UncheckedIOException;
@ -15,7 +15,7 @@ import me.topchetoeu.jscript.common.events.Notifier;
import me.topchetoeu.jscript.common.json.JSON;
import me.topchetoeu.jscript.common.json.JSONList;
import me.topchetoeu.jscript.common.json.JSONMap;
import me.topchetoeu.jscript.core.engine.debug.WebSocketMessage.Type;
import me.topchetoeu.jscript.utils.debug.WebSocketMessage.Type;
import me.topchetoeu.jscript.core.exceptions.SyntaxException;
public class DebugServer {

View File

@ -0,0 +1,7 @@
package me.topchetoeu.jscript.utils.debug;
import me.topchetoeu.jscript.core.engine.debug.DebugController;
public interface Debugger extends DebugHandler, DebugController {
void close();
}

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
public interface DebuggerProvider {
Debugger getDebugger(WebSocket socket, HttpRequest req);

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.io.BufferedReader;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.io.IOException;
import java.util.ArrayList;
@ -22,6 +22,7 @@ import me.topchetoeu.jscript.core.compilation.Instruction.Type;
import me.topchetoeu.jscript.core.engine.Context;
import me.topchetoeu.jscript.core.engine.Engine;
import me.topchetoeu.jscript.core.engine.Environment;
import me.topchetoeu.jscript.core.engine.debug.DebugContext;
import me.topchetoeu.jscript.core.engine.frame.CodeFrame;
import me.topchetoeu.jscript.core.engine.scope.GlobalScope;
import me.topchetoeu.jscript.core.engine.values.ArrayValue;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import me.topchetoeu.jscript.common.json.JSON;
import me.topchetoeu.jscript.common.json.JSONMap;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import me.topchetoeu.jscript.common.json.JSON;
import me.topchetoeu.jscript.common.json.JSONMap;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import me.topchetoeu.jscript.common.json.JSON;
import me.topchetoeu.jscript.common.json.JSONMap;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@ -6,7 +6,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import me.topchetoeu.jscript.core.engine.debug.WebSocketMessage.Type;
import me.topchetoeu.jscript.utils.debug.WebSocketMessage.Type;
public class WebSocket implements AutoCloseable {
public long maxLength = 1 << 20;

View File

@ -1,4 +1,4 @@
package me.topchetoeu.jscript.core.engine.debug;
package me.topchetoeu.jscript.utils.debug;
public class WebSocketMessage {
public static enum Type {

View File

@ -6,6 +6,7 @@ import java.util.TreeMap;
import java.util.stream.Collectors;
import me.topchetoeu.jscript.common.Location;
import me.topchetoeu.jscript.common.VLQ;
import me.topchetoeu.jscript.common.json.JSON;
public class SourceMap {