tosijs-ui 1.12.6 → 1.12.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.7
4
+
5
+ ### Live-example and doc-test failures now tell you where
6
+
7
+ A failing doc test used to report one entry for the whole block, with no file, no line and no
8
+ stack:
9
+
10
+ ```
11
+ ✗ Test execution: Arg string terminates parameters early
12
+ ```
13
+
14
+ The only way to narrow that is to bisect the file by hand, which is what it cost the person who
15
+ reported it ([#111](https://github.com/tonioloewald/tosijs-ui/issues/111)) — and both theories
16
+ the bisection bought were wrong, because the message named nothing that was actually involved.
17
+
18
+ Three things were wrong, and none of them were the transpiler:
19
+
20
+ - **The stack was discarded.** The catch kept `err.message` only — fifteen lines below the code
21
+ that tags the body `//# sourceURL=inline-test` precisely so that stack would carry usable line
22
+ numbers. Failures now read `message | the offending source (line N)`.
23
+ - **Live examples never tagged a sourceURL at all**, so a broken example's stack pointed into
24
+ the minified bundle. Now tagged, and the preview error carries the same location.
25
+ `notDefinedAnywhere is not defined` became
26
+ `notDefinedAnywhere is not defined | notDefinedAnywhere() (line 3)`.
27
+ - **The line numbers were off by two, and always had been.** The `Function` constructor
28
+ synthesizes a header, so every line an engine reports is shifted from the line the author
29
+ wrote — measured at **+2** in Chromium and Firefox, for `Function` and `AsyncFunction` alike,
30
+ regardless of parameter count, and additive. So assertion failures have been naming the line
31
+ _two below_ the failing assertion for as long as that feature has existed, and quoting that
32
+ line's source alongside it. That is worse than saying nothing: it reads as correct, because
33
+ the quoted text is real code from the same file.
34
+
35
+ The offset is **calibrated at runtime** by one cached probe rather than hardcoded to 2 — it is
36
+ an unspecified detail of whichever engine is running, and a stale constant would reintroduce
37
+ the defect it fixes. If the correction would produce a line below 1, no line is reported rather
38
+ than a false one. WebKit produces no locatable frame for constructed functions, so it falls back
39
+ to the bare message, exactly as before.
40
+
41
+ ### A constructor failure now names the context keys
42
+
43
+ The remaining case has no line to report at all, because nothing ran: the `AsyncFunction`
44
+ constructor rejected the code before executing it. That was #111's actual failure.
45
+
46
+ If the same body compiles with **no** parameters, the body is fine and the caller's `context`
47
+ keys are at fault — so the message now says that and lists the parameter list they became. A key
48
+ that cannot be an identifier (a subpath like `pkg/sub`, a scoped name, a leading digit) is the
49
+ usual cause, and none of that was inferable from `Arg string terminates parameters early`.
50
+
3
51
  ## 1.12.6
4
52
 
5
53
  ### `<tosi-diff resolvable>` — "do I want to accept this?"