@miaskiewicz/turbo-dom 0.1.24 → 0.1.25

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.24",
3
+ "version": "0.1.25",
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",
@@ -338,7 +338,7 @@ export class Element extends Node {
338
338
  super(ownerDocument);
339
339
  this.localName = localName;
340
340
  this.__ns = namespace; // '', 'svg', 'math'
341
- this.__attrs = []; // [{name, value, prefix}]
341
+ this.__attrs = undefined; // lazily built (buffer or []) on first attr touch
342
342
  this.__attrIdx = -1; // buffer index for lazy attr inflation
343
343
  this.content = null; // <template> content fragment
344
344
  this.shadowRoot = null; // open shadow root, if attached
@@ -1106,7 +1106,7 @@ export class Document extends Node {
1106
1106
  case ELEMENT_NODE: {
1107
1107
  node = new Element(this, buf.tagName(idx), buf.ns(idx));
1108
1108
  node.__idx = idx;
1109
- node.__attrIdx = idx; node.__attrs = undefined; // lazy: build on first attr access
1109
+ node.__attrIdx = idx; // attrs lazy (constructor left __attrs undefined)
1110
1110
  // template content fragment: a child node typed 11 named "content"
1111
1111
  if (buf.tagName(idx) === 'template') {
1112
1112
  for (let c = buf.firstChild(idx); c !== -1; c = buf.nextSib(c)) {