@miaskiewicz/turbo-dom 0.1.35 → 0.1.36
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miaskiewicz/turbo-dom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"description": "Faster, more spec-correct DOM for test runners — native html5ever (Rust/WASM) parser + lazy copy-on-write DOM. A drop-in-style alternative to jsdom/happy-dom for vitest & jest.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
package/src/runtime/dom.mjs
CHANGED
|
@@ -1362,7 +1362,7 @@ export class Document extends Node {
|
|
|
1362
1362
|
this.__cache = []; // idx -> handle (identity memoization / nodeAt)
|
|
1363
1363
|
this.__active = null; // activeElement
|
|
1364
1364
|
this.defaultView = null; // set by environment (window)
|
|
1365
|
-
this.__mo =
|
|
1365
|
+
this.__mo = null; // registered MutationObservers (lazy — most files never observe())
|
|
1366
1366
|
this.__moPending = null; // observers with queued records awaiting microtask
|
|
1367
1367
|
}
|
|
1368
1368
|
get nodeType() { return DOCUMENT_NODE; }
|
|
@@ -1371,10 +1371,11 @@ export class Document extends Node {
|
|
|
1371
1371
|
// ---- MutationObserver registry ----
|
|
1372
1372
|
__moRegister(obs, target, options) {
|
|
1373
1373
|
// replace existing registration for (obs,target) per spec
|
|
1374
|
-
this.__mo
|
|
1374
|
+
if (!this.__mo) this.__mo = [];
|
|
1375
|
+
else this.__mo = this.__mo.filter((r) => !(r.obs === obs && r.target === target));
|
|
1375
1376
|
this.__mo.push({ obs, target, options });
|
|
1376
1377
|
}
|
|
1377
|
-
__moUnregister(obs) { this.__mo = this.__mo.filter((r) => r.obs !== obs); }
|
|
1378
|
+
__moUnregister(obs) { if (this.__mo) this.__mo = this.__mo.filter((r) => r.obs !== obs); }
|
|
1378
1379
|
__scheduleMO(obs) {
|
|
1379
1380
|
if (!this.__moPending) this.__moPending = new Set();
|
|
1380
1381
|
if (this.__moPending.has(obs)) return;
|
|
Binary file
|