Skip to content

Commit 1247b06

Browse files
committed
docs(runtime): the listener-bag rule is Node parity plus patch independence, not a live crash
The wrapper-keyed-WeakMap corruption was a collector bug fixed in the v8-14.9.207.39-6 prebuilts; the rule stays because own-instance state is Node's design for handler attributes and keeps the builtins off the resurrection/ephemeron interplay the kFinalizer patch must re-cover on every V8 upgrade.
1 parent 1540ff8 commit 1247b06

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

NativeScript/runtime/js/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ The two extra rules a lazy builtin lives by:
117117
are whatever user code left behind, so it should not reach for them at all.
118118
- The per-instance wrappers `defineEventHandler` creates live on the target's
119119
**own listener bag**, under a private symbol — never in a WeakMap keyed by
120-
the target. ObjectManager-registered wrappers may be resurrected by their
121-
finalizer (the patched collector's `kFinalizer` mechanism), and a
122-
resurrected ephemeron key is a known corruption hazard in the concurrent
123-
marker — `Worker` has since moved to a strong-while-running lifetime, but
124-
the rule protects against every other resurrectable wrapper type.
120+
the target. Own-instance state is Node's own design for handler attributes,
121+
and it keeps the builtins independent of the patched collector's handling of
122+
resurrected ephemeron keys (`kFinalizer` resurrection interacting with
123+
WeakMaps has been a source of collector bugs, and the patch is re-ported on
124+
every V8 upgrade — builtins not leaning on it means a re-port mistake breaks
125+
app-level tests, not the event system itself).
125126
- No `import`/`export` — these are classic function bodies, not modules.
126127
- ESLint (`eslint.config.mjs` at the repo root, run by lint-staged) declares
127128
`exports`, `require`, `module`, `binding`, `primordials` and the reachable

0 commit comments

Comments
 (0)