@nanobpm/engine-wasm 0.7.2 → 0.8.1

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.
@@ -1343,3 +1343,25 @@ async function __wbg_init(module_or_path) {
1343
1343
  }
1344
1344
 
1345
1345
  export { initSync, __wbg_init as default };
1346
+
1347
+ // --- nanobpm: use-after-free DX guard (scripts/inject-free-guard.mjs) ---
1348
+ // wasm-bindgen throws the opaque "null pointer passed to rust" when a method is
1349
+ // called on a freed handle (__wbg_ptr === 0). Re-describe that as a clear
1350
+ // use-after-free so a host lifecycle bug is diagnosable at the call site. The
1351
+ // call is still refused — this only changes the message, not the behaviour.
1352
+ for (const __name of Object.getOwnPropertyNames(TestEngine.prototype)) {
1353
+ if (__name === "constructor" || __name === "free" || __name === "__destroy_into_raw") continue;
1354
+ const __desc = Object.getOwnPropertyDescriptor(TestEngine.prototype, __name);
1355
+ if (!__desc || typeof __desc.value !== "function") continue;
1356
+ const __orig = __desc.value;
1357
+ const __guarded = {
1358
+ [__name](...__args) {
1359
+ if (this.__wbg_ptr === 0) {
1360
+ throw new Error("TestEngine used after free(): '" + __name + "' called on a released engine handle");
1361
+ }
1362
+ return __orig.apply(this, __args);
1363
+ },
1364
+ }[__name];
1365
+ Object.defineProperty(TestEngine.prototype, __name, { ...__desc, value: __guarded });
1366
+ }
1367
+ // --- end nanobpm use-after-free DX guard ---
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanobpm/engine-wasm",
3
- "version": "0.7.2",
3
+ "version": "0.8.1",
4
4
  "description": "The nanobpmn engine (engine-core) compiled to WebAssembly for in-browser BPMN execution: deploy a diagram, start instances, activate/complete jobs, and read live snapshots/traces. Published as two subpath entrypoints — a lean baseline engine (default) and a read-model engine (the gateway's C8-style REST read surface). The substrate for the Bojtos demo framework (ADR 0043) and the console test-run panel.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1594,3 +1594,25 @@ async function __wbg_init(module_or_path) {
1594
1594
  }
1595
1595
 
1596
1596
  export { initSync, __wbg_init as default };
1597
+
1598
+ // --- nanobpm: use-after-free DX guard (scripts/inject-free-guard.mjs) ---
1599
+ // wasm-bindgen throws the opaque "null pointer passed to rust" when a method is
1600
+ // called on a freed handle (__wbg_ptr === 0). Re-describe that as a clear
1601
+ // use-after-free so a host lifecycle bug is diagnosable at the call site. The
1602
+ // call is still refused — this only changes the message, not the behaviour.
1603
+ for (const __name of Object.getOwnPropertyNames(TestEngine.prototype)) {
1604
+ if (__name === "constructor" || __name === "free" || __name === "__destroy_into_raw") continue;
1605
+ const __desc = Object.getOwnPropertyDescriptor(TestEngine.prototype, __name);
1606
+ if (!__desc || typeof __desc.value !== "function") continue;
1607
+ const __orig = __desc.value;
1608
+ const __guarded = {
1609
+ [__name](...__args) {
1610
+ if (this.__wbg_ptr === 0) {
1611
+ throw new Error("TestEngine used after free(): '" + __name + "' called on a released engine handle");
1612
+ }
1613
+ return __orig.apply(this, __args);
1614
+ },
1615
+ }[__name];
1616
+ Object.defineProperty(TestEngine.prototype, __name, { ...__desc, value: __guarded });
1617
+ }
1618
+ // --- end nanobpm use-after-free DX guard ---
Binary file