@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.
- package/dist/index-workers.cjs +9 -0
- package/dist/index-workers.cjs.map +1 -1
- package/dist/index-workers.js +9 -0
- package/dist/index-workers.js.map +1 -1
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index-workers.js
CHANGED
|
@@ -2249,6 +2249,11 @@ var RpcSessionImpl = class {
|
|
|
2249
2249
|
this.transport.send(msgText).catch((err) => this.abort(err, false));
|
|
2250
2250
|
return msgText.length;
|
|
2251
2251
|
}
|
|
2252
|
+
isDirectFunctionCall(expression) {
|
|
2253
|
+
if (!(expression instanceof Array)) return false;
|
|
2254
|
+
let [kind, _id, path, args] = expression;
|
|
2255
|
+
return kind === "pipeline" && expression.length === 4 && path instanceof Array && path.length === 0 && args instanceof Array;
|
|
2256
|
+
}
|
|
2252
2257
|
sendCall(id, path, args) {
|
|
2253
2258
|
if (this.abortReason) throw this.abortReason;
|
|
2254
2259
|
let value = ["pipeline", id, path];
|
|
@@ -2377,7 +2382,11 @@ var RpcSessionImpl = class {
|
|
|
2377
2382
|
let payload = new Evaluator(this).evaluate(msg[1]);
|
|
2378
2383
|
let hook = new PayloadStubHook(payload);
|
|
2379
2384
|
hook.ignoreUnhandledRejections();
|
|
2385
|
+
let exportId = this.exports.length;
|
|
2380
2386
|
this.exports.push({ hook, refcount: 1 });
|
|
2387
|
+
if (this.isDirectFunctionCall(msg[1])) {
|
|
2388
|
+
this.ensureResolvingExport(exportId);
|
|
2389
|
+
}
|
|
2381
2390
|
continue;
|
|
2382
2391
|
}
|
|
2383
2392
|
break;
|