x-runtime-lib 0.8.193 → 0.8.194

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
@@ -10000,6 +10000,10 @@ function newAny(e, w) {
10000
10000
  default: return e.undefined;
10001
10001
  }
10002
10002
  }
10003
+ function makeFuncInfo(e, ...w) {
10004
+ let T = e;
10005
+ return T += "(", T += w.map((e) => JSON.stringify(e)).join(", "), T += ")", T;
10006
+ }
10003
10007
  function bindBase(e) {
10004
10008
  if (!e.vm) {
10005
10009
  console.error("bindBase invalid sandbox vm");
@@ -10237,12 +10241,11 @@ var PromiseManager = class {
10237
10241
  var T = _usingCtx();
10238
10242
  let { vm: E } = this;
10239
10243
  if (!E) throw Error("vm not available");
10240
- let D = `${e}(${w.map((e) => JSON.stringify(e)).join(", ")})`;
10241
- noTraceCallFuncs.includes(e) || this.debugTrace(`${D}`);
10242
- let O = T.u(E.getProp(E.global, e));
10243
- if (E.typeof(O) !== "function") throw Error(`function<${e}> not available`);
10244
- let k = w.map((e) => newAny(E, e)), A = E.unwrapResult(E.callFunction(O, E.undefined, ...k)).consume((e) => E.dump(e));
10245
- return k.forEach((e) => e.dispose()), A;
10244
+ noTraceCallFuncs.includes(e) || this.debugTrace(makeFuncInfo(e, ...w));
10245
+ let D = T.u(E.getProp(E.global, e));
10246
+ if (E.typeof(D) !== "function") throw Error(`function<${e}> not available`);
10247
+ let O = w.map((e) => newAny(E, e)), k = E.unwrapResult(E.callFunction(D, E.undefined, ...O)).consume((e) => E.dump(e));
10248
+ return O.forEach((e) => e.dispose()), k;
10246
10249
  } catch (e) {
10247
10250
  T.e = e;
10248
10251
  } finally {
@@ -10254,12 +10257,11 @@ var PromiseManager = class {
10254
10257
  var T = _usingCtx();
10255
10258
  let { vm: E } = this;
10256
10259
  if (!E) throw Error("vm not available");
10257
- let D = `${e}(${w.map((e) => JSON.stringify(e)).join(", ")})`;
10258
- noTraceCallFuncs.includes(e) || this.debugTrace(`${D}`);
10259
- let O = T.u(E.getProp(E.global, e));
10260
- if (E.typeof(O) !== "function") throw Error(`function<${e}> not available`);
10261
- let k = w.map((e) => newAny(E, e)), A = E.unwrapResult(E.callFunction(O, E.undefined, ...k)).consume((e) => E.resolvePromise(e));
10262
- return E.runtime.executePendingJobs(), k.map((e) => e.dispose()), E.unwrapResult(await A).consume((e) => E.dump(e));
10260
+ noTraceCallFuncs.includes(e) || this.debugTrace(makeFuncInfo(e, ...w));
10261
+ let D = T.u(E.getProp(E.global, e));
10262
+ if (E.typeof(D) !== "function") throw Error(`function<${e}> not available`);
10263
+ let O = w.map((e) => newAny(E, e)), k = E.unwrapResult(E.callFunction(D, E.undefined, ...O)).consume((e) => E.resolvePromise(e));
10264
+ return E.runtime.executePendingJobs(), O.map((e) => e.dispose()), E.unwrapResult(await k).consume((e) => E.dump(e));
10263
10265
  } catch (e) {
10264
10266
  T.e = e;
10265
10267
  } finally {
@@ -10285,6 +10287,7 @@ var PromiseManager = class {
10285
10287
  return !T || !T.events ? !1 : !!T.events.find((e) => e.id === w);
10286
10288
  }
10287
10289
  async triggerEvent(e, w, ...T) {
10290
+ this.debugTrace("triggerEvent", e, w, ...T);
10288
10291
  let { kind: E, nodeId: D, eventKey: O } = unwrapEventId(e);
10289
10292
  if (await this.callFunctionAsync("__triggerEventInner__", e, w, ...T), E === "elementSlotEvent") {
10290
10293
  let e = this.children[D];
@@ -10329,6 +10332,7 @@ var PromiseManager = class {
10329
10332
  return !T || !T.properties ? !1 : !!T.properties.find((e) => e.id === w);
10330
10333
  }
10331
10334
  async getProperty(e, w) {
10335
+ this.debugTrace(makeFuncInfo("getProperty", e, w ?? ""));
10332
10336
  let { kind: T, nodeId: E, propertyKey: D } = unwrapPropertyId(e), O = this.data.value?.view.nodes[E];
10333
10337
  if (!O) throw Error("node not found");
10334
10338
  if (T === "elementProperty") return await this.getElementProperty(O, D);
@@ -10406,6 +10410,7 @@ var PromiseManager = class {
10406
10410
  return this.customSlotProperties[T];
10407
10411
  }
10408
10412
  async setProperty(e, w, T) {
10413
+ this.debugTrace(makeFuncInfo("setProperty", e, w, T ?? ""));
10409
10414
  let { kind: E, nodeId: O, propertyKey: k } = unwrapPropertyId(e), A = this.data.value?.view.nodes[O];
10410
10415
  if (!A) throw Error("node not found");
10411
10416
  if (w = cloneDeep_default(w), E === "elementProperty") await this.setElementProperty(e, w, k, A);
@@ -10515,6 +10520,7 @@ var PromiseManager = class {
10515
10520
  return !T || !T.methods ? !1 : !!T.methods.find((e) => e.id === w);
10516
10521
  }
10517
10522
  async callMethod(e, w, T) {
10523
+ this.debugTrace(makeFuncInfo("callMethod", e, w, T));
10518
10524
  let { kind: E, nodeId: D, methodKey: O } = unwrapMethodId(e), k = this.data.value?.view.nodes[D];
10519
10525
  if (!k) throw Error("node not found");
10520
10526
  if (E === "elementMethod") await this.callElementMethod(e, T, k.basic.key, O);
@@ -10598,6 +10604,7 @@ var PromiseManager = class {
10598
10604
  return this.states[e];
10599
10605
  }
10600
10606
  async setState(e, w) {
10607
+ this.debugTrace("setState", e, w);
10601
10608
  let T = this.states[e];
10602
10609
  isEqual_default(w, T) || (this.states[e] = cloneDeep_default(w), this.hooks.onStateChange(e, w, T), await nextTick());
10603
10610
  }
@@ -6,3 +6,4 @@ export interface Inputs {
6
6
  [key: string]: any;
7
7
  }
8
8
  export declare function newAny(vm: QuickJSContext, value: any): import("quickjs-emscripten").QuickJSHandle;
9
+ export declare function makeFuncInfo(funcName: string, ...params: any[]): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.193",
4
+ "version": "0.8.194",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",