x-runtime-lib 0.8.64 → 0.8.66

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/dist/index.js CHANGED
@@ -8481,21 +8481,19 @@ function Su(t) {
8481
8481
  u && u.setCustomProperty(d, a);
8482
8482
  } else c === "customProperty" ? t.setCustomProperty(d, a) : c === "elementSlotProperty" || c === "customSlotProperty" ? t.setAdaptSlotProperty(d, a) : console.assert(!1);
8483
8483
  }
8484
- ), t.bindAsyncFunction(
8484
+ ), t.bindNativeFunction(
8485
8485
  "__callMethodV1__",
8486
- (e, i, o, s) => {
8487
- const r = t.pseudoToNative(e), a = t.pseudoToNative(i), c = t.pseudoToNative(o), { kind: p, nodeId: d, methodKey: u } = jo(r);
8488
- let m;
8489
- if (p === "elementMethod")
8490
- m = t.callElementMethod(r, c);
8491
- else if (p === "referenceMethod") {
8492
- const y = t.children[d];
8493
- y && (m = y.callCustomMethod(u, c));
8494
- } else if (p === "multipleRefMethod") {
8495
- const y = t.children[d + "/" + a];
8496
- y && (m = y.callCustomMethod(u, c));
8497
- } else p === "customMethod" ? m = t.callCustomMethod(u, c) : p === "customSlotMethod" || console.assert(!1);
8498
- s(t.nativeToPseudo(m)), t.run();
8486
+ (e, i, o) => {
8487
+ const s = t.pseudoToNative(e), r = t.pseudoToNative(i), a = t.pseudoToNative(o), { kind: c, nodeId: p, methodKey: d } = jo(s);
8488
+ if (c === "elementMethod")
8489
+ t.callElementMethod(s, a);
8490
+ else if (c === "referenceMethod") {
8491
+ const u = t.children[p];
8492
+ u && u.callCustomMethod(d, a);
8493
+ } else if (c === "multipleRefMethod") {
8494
+ const u = t.children[p + "/" + r];
8495
+ u && u.callCustomMethod(d, a);
8496
+ } else c === "customMethod" ? t.callCustomMethod(d, a) : c === "customSlotMethod" || console.assert(!1);
8499
8497
  }
8500
8498
  ), t.bindNativeFunction("__getStateV1__", (e) => {
8501
8499
  const i = t.pseudoToNative(e), o = t.getState(i);
@@ -8753,15 +8751,15 @@ ${Ir(e)}} catch (e) {
8753
8751
  return;
8754
8752
  }
8755
8753
  const o = [];
8756
- for (const a of i)
8757
- o.push(JSON.stringify(a));
8758
- const r = `try {
8759
- ${`${e}(${o.join(", ")});`}
8754
+ for (const r of i)
8755
+ o.push(JSON.stringify(r));
8756
+ const s = `try {
8757
+ var __callFunctionResult__ = ${e}(${o.join(", ")});
8760
8758
  } catch (e) {
8761
8759
  __messageV1__('error', 'run exception: ' + e.message);
8762
8760
  }
8763
8761
  `;
8764
- to(r), this.interpreter.appendCode(r), this.interpreter.run();
8762
+ to(s), this.interpreter.appendCode(s), this.interpreter.run();
8765
8763
  }
8766
8764
  //--------------------------
8767
8765
  // 元素属性
@@ -8852,10 +8850,7 @@ ${Ir(e)}} catch (e) {
8852
8850
  return this.eventBus.emit(e, { key: o, inputs: i, outputs: s }), s;
8853
8851
  }
8854
8852
  callCustomMethod(e, i) {
8855
- if (!Q(this.mode))
8856
- return;
8857
- const o = {};
8858
- return console.error("callCustomMethod", i), this.callFunction(`__implementMethod$${e}__`, i), o;
8853
+ Q(this.mode) && this.callFunction(`__implementMethod$${e}__`, i);
8859
8854
  }
8860
8855
  //--------------------------
8861
8856
  // 状态
@@ -58,9 +58,7 @@ export declare class Sandbox {
58
58
  } | undefined;
59
59
  callCustomMethod(key: string, inputs: {
60
60
  [key: string]: any;
61
- }): {
62
- [key: string]: any;
63
- } | undefined;
61
+ }): void;
64
62
  private states;
65
63
  resetStates(): void;
66
64
  getState(stateId: string): any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.64",
4
+ "version": "0.8.66",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",