@vastblast/capnweb 0.7.4 → 0.7.5

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.
@@ -2271,6 +2271,11 @@ var RpcSessionImpl = class {
2271
2271
  this.transport.send(msgText).catch((err) => this.abort(err, false));
2272
2272
  return msgText.length;
2273
2273
  }
2274
+ isDirectFunctionCall(expression) {
2275
+ if (!(expression instanceof Array)) return false;
2276
+ let [kind, _id, path, args] = expression;
2277
+ return kind === "pipeline" && expression.length === 4 && path instanceof Array && path.length === 0 && args instanceof Array;
2278
+ }
2274
2279
  sendCall(id, path, args) {
2275
2280
  if (this.abortReason) throw this.abortReason;
2276
2281
  let value = ["pipeline", id, path];
@@ -2399,7 +2404,11 @@ var RpcSessionImpl = class {
2399
2404
  let payload = new Evaluator(this).evaluate(msg[1]);
2400
2405
  let hook = new PayloadStubHook(payload);
2401
2406
  hook.ignoreUnhandledRejections();
2407
+ let exportId = this.exports.length;
2402
2408
  this.exports.push({ hook, refcount: 1 });
2409
+ if (this.isDirectFunctionCall(msg[1])) {
2410
+ this.ensureResolvingExport(exportId);
2411
+ }
2403
2412
  continue;
2404
2413
  }
2405
2414
  break;