mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
add two function
This commit is contained in:
parent
d3cddb1773
commit
3321ab23c2
@ -226,6 +226,18 @@ public class DesktopEngine extends JSEngine {
|
||||
}
|
||||
}
|
||||
|
||||
public Object invokeFunction(String functionName, Object... args) {
|
||||
Invocable cal = engine;
|
||||
try {
|
||||
return cal.invokeFunction(functionName, args);
|
||||
} catch (ScriptException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Resources getResources() {
|
||||
return this.resources;
|
||||
}
|
||||
@ -404,10 +416,11 @@ public class DesktopEngine extends JSEngine {
|
||||
}
|
||||
}
|
||||
|
||||
private void compileFunction(String snippet, boolean instrumentBranch) throws ScriptException {
|
||||
public void compileFunction(String snippet, boolean instrumentBranch) throws ScriptException {
|
||||
compileFunction((ScriptObjectMirror) engine.eval(snippet), instrumentBranch);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized ContractResult executeContract(ContractRequest input) {
|
||||
ContractProcess.Logger previous = this.getTracePS();
|
||||
|
Loading…
Reference in New Issue
Block a user