Fix js builder
This commit is contained in:
parent
c2f8e12576
commit
177f2e6625
1 changed files with 8 additions and 2 deletions
|
@ -56,8 +56,14 @@ public class JSCommandBuilder extends CommandBuilder {
|
|||
|
||||
private JSCommandBuilder addCommand(String name, Object... args){
|
||||
listCommands.add(name);
|
||||
listCommands.add(Arrays.toString(args));
|
||||
Object obj = jsScope.get(name);
|
||||
for(Object o : args) {
|
||||
if(o != null) {
|
||||
listCommands.add(o.toString());
|
||||
} else {
|
||||
listCommands.add("");
|
||||
}
|
||||
}
|
||||
Object obj = jsScope.get(name);
|
||||
if (obj instanceof Function) {
|
||||
Function jsFunction = (Function) obj;
|
||||
Object jsResult = jsFunction.call(jsContext, jsScope, jsScope, args);
|
||||
|
|
Loading…
Reference in a new issue