debugging add module support
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
@@ -131,6 +132,15 @@ public class DoricDev {
|
||||
.toJSONObject());
|
||||
} else {
|
||||
final DoricContext context = contexts.get(contexts.size() - 1);
|
||||
Map<String, String> bundles = DoricSingleton.getInstance().getJSBundles();
|
||||
for (String key : bundles.keySet()) {
|
||||
wsClient.sendToDebugger(
|
||||
"LOAD_MODULE",
|
||||
new JSONBuilder()
|
||||
.put("name", key)
|
||||
.put("content", bundles.get(key))
|
||||
.toJSONObject());
|
||||
}
|
||||
wsClient.sendToDebugger(
|
||||
"DEBUG_RES",
|
||||
new JSONBuilder()
|
||||
|
@@ -19,19 +19,17 @@ import pub.doric.devkit.WSClient;
|
||||
public class RemoteJSExecutor implements WSClient.Interceptor {
|
||||
private final Map<String, JavaFunction> globalFunctions = new HashMap<>();
|
||||
private final WSClient wsClient;
|
||||
private final Thread currentThread;
|
||||
|
||||
private final AtomicInteger callIdCounter = new AtomicInteger();
|
||||
|
||||
private Map<Integer, Thread> mThreads = new HashMap<>();
|
||||
private Map<Integer, JSDecoder> mResults = new HashMap<>();
|
||||
private final Map<Integer, Thread> mThreads = new HashMap<>();
|
||||
private final Map<Integer, JSDecoder> mResults = new HashMap<>();
|
||||
|
||||
public volatile boolean invokingMethod = false;
|
||||
|
||||
public RemoteJSExecutor(WSClient wsClient) {
|
||||
this.wsClient = wsClient;
|
||||
this.wsClient.addInterceptor(this);
|
||||
currentThread = Thread.currentThread();
|
||||
}
|
||||
|
||||
public String loadJS(String script, String source) {
|
||||
|
@@ -91,4 +91,8 @@ public class DoricSingleton {
|
||||
public DoricContextManager getContextManager() {
|
||||
return doricContextManager;
|
||||
}
|
||||
|
||||
public Map<String, String> getJSBundles() {
|
||||
return bundles;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user