dolphindb 3.0.108 → 3.0.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.js +26 -3
- package/browser.js.map +1 -1
- package/docs.en.json +6894 -6325
- package/docs.zh.json +1431 -1291
- package/i18n/dict.json +3 -0
- package/index.js +26 -3
- package/index.js.map +1 -1
- package/package.json +3 -3
package/browser.js
CHANGED
|
@@ -3193,9 +3193,32 @@ export class DDB {
|
|
|
3193
3193
|
' args = cast(args, ANY)\n' +
|
|
3194
3194
|
' return unifiedCall(funcByName(func_name), args)\n' +
|
|
3195
3195
|
'}\n', { urgent: true }));
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3196
|
+
// 检查 args 是否全部为简单参数,是则直接调用 call,避免 invoke 间接调用
|
|
3197
|
+
// 逻辑类似 DdbObj.to_ddbobjs, 需要同步修改
|
|
3198
|
+
let simple = true;
|
|
3199
|
+
let has_ddbobj = false;
|
|
3200
|
+
for (const arg of args) {
|
|
3201
|
+
if (arg && arg instanceof DdbObj)
|
|
3202
|
+
has_ddbobj = true;
|
|
3203
|
+
else {
|
|
3204
|
+
const type = typeof arg;
|
|
3205
|
+
if (type === 'string' || type === 'boolean') { }
|
|
3206
|
+
else {
|
|
3207
|
+
simple = false;
|
|
3208
|
+
break;
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
if (!simple) {
|
|
3213
|
+
if (has_ddbobj)
|
|
3214
|
+
throw new Error(t('调用 ddb.invoke 的参数中不能同时有 DdbObj 与复杂 js 原生对象'));
|
|
3215
|
+
if (options?.node)
|
|
3216
|
+
options.func_type = DdbFunctionType.UserDefinedFunc;
|
|
3217
|
+
}
|
|
3218
|
+
const result = simple
|
|
3219
|
+
? await this.call(func, args, options)
|
|
3220
|
+
: await this.call('invoke', [func, JSON.stringify(args)], options);
|
|
3221
|
+
return result.data();
|
|
3199
3222
|
}
|
|
3200
3223
|
/** 执行 dolphindb 脚本,返回 js 原生对象或值(调用 DdbObj.data() 后的结果)
|
|
3201
3224
|
- script?: 执行的脚本
|