mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
fix: fix bugs in event mechanism
This commit is contained in:
parent
372a8bd869
commit
eb371580af
@ -459,11 +459,11 @@ public class DesktopEngine extends JSEngine {
|
|||||||
this.redirectTracePS(ppc);
|
this.redirectTracePS(ppc);
|
||||||
}
|
}
|
||||||
Invocable cal = engine;
|
Invocable cal = engine;
|
||||||
if (fun.isExport()
|
if (fun.isExport() ||
|
||||||
// if the function has been registered as event handler
|
// if the function has been registered as event handler
|
||||||
|| (fun.isHandler()
|
(fun.isHandler() &&
|
||||||
&& (input.getRequester().length() == 40
|
null != input.getRequester() &&
|
||||||
|| input.getRequester().equals("event")))) {
|
input.getRequester().startsWith("event"))) {
|
||||||
Object ret = null;
|
Object ret = null;
|
||||||
// long start = System.currentTimeMillis();
|
// long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
@ -10,8 +10,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
public class JSONTool {
|
public class JSONTool {
|
||||||
public static JsonElement convertMirrorToJson(Object ret2) {
|
public static JsonElement convertMirrorToJson(Object ret2) {
|
||||||
JsonElement jsonElement = convertMirrorToJsonInternal(ret2, new HashSet<>());
|
return convertMirrorToJsonInternal(ret2, new HashSet<>());
|
||||||
return jsonElement;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object convertJsonElementToMirror(JsonElement jsonElement) {
|
public static Object convertJsonElementToMirror(JsonElement jsonElement) {
|
||||||
@ -57,7 +56,7 @@ public class JSONTool {
|
|||||||
for (String str : som.getOwnKeys(true)) {
|
for (String str : som.getOwnKeys(true)) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(str) >= 0)
|
if (Integer.parseInt(str) >= 0)
|
||||||
jarray.add(convertMirrorToJsonInternal(som.getMember(str),recorded));
|
jarray.add(convertMirrorToJsonInternal(som.getMember(str), recorded));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// System.out.println("[JSONTool] ignore key:"+str);
|
// System.out.println("[JSONTool] ignore key:"+str);
|
||||||
}
|
}
|
||||||
@ -66,7 +65,7 @@ public class JSONTool {
|
|||||||
} else {
|
} else {
|
||||||
JsonObject jo = new JsonObject();
|
JsonObject jo = new JsonObject();
|
||||||
for (String str : som.getOwnKeys(true)) {
|
for (String str : som.getOwnKeys(true)) {
|
||||||
jo.add(str, convertMirrorToJsonInternal(som.getMember(str),recorded));
|
jo.add(str, convertMirrorToJsonInternal(som.getMember(str), recorded));
|
||||||
}
|
}
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
@ -83,7 +82,7 @@ public class JSONTool {
|
|||||||
for (String str : som.getOwnKeys(true)) {
|
for (String str : som.getOwnKeys(true)) {
|
||||||
try {
|
try {
|
||||||
if (Integer.parseInt(str) >= 0)
|
if (Integer.parseInt(str) >= 0)
|
||||||
jarray.add(convertMirrorToJsonInternal(som.getMember(str),recorded));
|
jarray.add(convertMirrorToJsonInternal(som.getMember(str), recorded));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// System.out.println("[JSONTool] ignore key:"+str);
|
// System.out.println("[JSONTool] ignore key:"+str);
|
||||||
}
|
}
|
||||||
@ -92,7 +91,7 @@ public class JSONTool {
|
|||||||
} else {
|
} else {
|
||||||
JsonObject jo = new JsonObject();
|
JsonObject jo = new JsonObject();
|
||||||
for (String str : som.getOwnKeys(true)) {
|
for (String str : som.getOwnKeys(true)) {
|
||||||
jo.add(str, convertMirrorToJsonInternal(som.getMember(str),recorded));
|
jo.add(str, convertMirrorToJsonInternal(som.getMember(str), recorded));
|
||||||
}
|
}
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user