• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hybridsjs / hybrids / 19760852732

28 Nov 2025 10:18AM UTC coverage: 42.528% (-57.4%) from 99.915%
19760852732

Pull #296

github

web-flow
Merge 191660095 into 92ed729fc
Pull Request #296: fix(store): improve `store.record()` support & error messages while defining the model

819 of 1842 branches covered (44.46%)

9 of 9 new or added lines in 1 file covered. (100.0%)

1345 existing lines in 27 files now uncovered.

996 of 2342 relevant lines covered (42.53%)

76.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

8.7
/src/mount.js
1
import define from "./define.js";
2
import { invalidate } from "./cache.js";
3
import { camelToDash } from "./utils.js";
4

5
const targets = new WeakMap();
2✔
6
const prevMap = new WeakMap();
2✔
7
export default function mount(target, hybrids) {
UNCOV
8
  const prevHybrids = prevMap.get(target);
×
UNCOV
9
  if (prevHybrids === hybrids) return;
×
10

UNCOV
11
  const HybridsElement = define.compile(hybrids);
×
UNCOV
12
  prevMap.set(target, hybrids);
×
13

UNCOV
14
  if (targets.has(target)) targets.get(target)();
×
15

UNCOV
16
  targets.set(target, () => {
×
UNCOV
17
    HybridsElement.prototype.disconnectedCallback.call(target);
×
18

UNCOV
19
    for (const [key] of descriptors) {
×
UNCOV
20
      delete target[key];
×
21
    }
22

UNCOV
23
    targets.delete(target);
×
24
  });
25

UNCOV
26
  const descriptors = Object.entries(
×
27
    Object.getOwnPropertyDescriptors(HybridsElement.prototype),
28
  );
29

UNCOV
30
  HybridsElement.prototype.connectedCallback.call(target);
×
31

UNCOV
32
  for (const [key, desc] of descriptors) {
×
UNCOV
33
    if (
×
34
      key === "constructor" ||
×
35
      key === "connectedCallback" ||
36
      key === "disconnectedCallback"
37
    ) {
UNCOV
38
      continue;
×
39
    }
40

UNCOV
41
    Object.defineProperty(target, key, {
×
42
      ...desc,
43
      configurable: true,
44
    });
45

UNCOV
46
    if (prevHybrids) {
×
UNCOV
47
      const type = typeof hybrids[key];
×
48
      const clearValue =
UNCOV
49
        type !== "object" &&
×
50
        type !== "function" &&
51
        hybrids[key] !== prevHybrids[key];
52

UNCOV
53
      if (clearValue) target.removeAttribute(camelToDash(key));
×
UNCOV
54
      invalidate(target, key, { clearValue });
×
55
    }
56
  }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc