Skip to content

Commit 88e77c2

Browse files
committed
远程函数:完善注释
1 parent c674916 commit 88e77c2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractFunctionParser.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,9 @@ public static Object invokeScript(@NotNull AbstractFunctionParser parser, @NotNu
289289
}
290290

291291
String script = row.getString("script");
292-
//SCRIPT_ENGINE.eval(script);
293-
//Object[] newArgs = args == null || args.length <= 0 ? null : new Object[args.length];
292+
SCRIPT_ENGINE.eval(script); // 必要,未执行导致下方 INVOCABLE.invokeFunction 报错 NoSuchMethod
294293

295-
SCRIPT_ENGINE.eval(script);
294+
//Object[] newArgs = args == null || args.length <= 0 ? null : new Object[args.length];
296295

297296
// APIJSON 远程函数不应该支持
298297
//if (row.getBooleanValue("simple")) {
@@ -311,7 +310,7 @@ public static Object invokeScript(@NotNull AbstractFunctionParser parser, @NotNu
311310
// newArgs[i] = a == null || apijson.JSON.isBooleanOrNumberOrString(a) ? a : JSON.toJSONString(a);
312311
//}
313312

314-
// TODO 先试试这个
313+
// 支持 JSONObject
315314
result = INVOCABLE.invokeFunction(methodName, args);
316315
//result = INVOCABLE.invokeMethod(args[0], methodName, args);
317316

@@ -349,7 +348,6 @@ public static Object invokeScript(@NotNull AbstractFunctionParser parser, @NotNu
349348
//}
350349
}
351350

352-
353351
if (Log.DEBUG && result != null) {
354352
Class<?> rt = result.getClass(); // 作为远程函数的 js 类型应该只有 JSON 的几种类型
355353
String fullReturnType = (StringUtil.isSmallName(returnType)

0 commit comments

Comments
 (0)