Skip to content

Mark the conformance todos that need a major release - #136

Merged
7rulnik merged 4 commits into
mainfrom
test/major-todos
Nov 29, 2026
Merged

7rulnik merged 4 commits into
mainfrom
test/major-todos

Conversation

@7rulnik

@7rulnik 7rulnik commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Twelve of the 14 conformance todos in test/test-ecma426-conformance.js can't be fixed without changing results for valid source maps, making maps that load today throw, or taking away leniency that tools rely on (numbers read as strings, a map with one stray comma keeping its mappings). The other todos change results only for invalid maps, without new throws. This marks them, so the test output says which todos wait for a major release and why.

They're now created with major(reason), which makes the test a todo whose reason starts with needs a major release:. node:test prints the reason next to the test:

⚠ a segment with more than 5 fields is rejected # needs a major release: maps that work today, with the extra fields ignored, would throw or lose every mapping
todo what the fix would change
null in sources sources would hold null for valid maps, where callers expect only strings
non-string sources entry numbers are read as strings on purpose ("consuming names and sources that are numbers")
non-string names entry same
non-string sourcesContent entry an index map's sourceContentFor() would throw for such a source, where it returns the value today
non-string file applySourceMap() without a source file would throw for such a map, where it runs today
VLQ encode out of range throws toJSON()/toString() would throw for mappings they write (wrongly) today
VLQ decode ≥ 2^32 throws the spec requires this error, so lookups would throw on maps that work today
B decodes to -2^31 maps that use B would decode to -2^31 instead of 0
non-string mappings rejected the spec requires this error, so maps that load today (with no mappings) would throw
more than 5 fields rejected maps that work today, with the extra fields ignored, would throw or lose every mapping
empty segment rejected maps that work today, with empty segments such as a trailing comma skipped, would throw or lose every mapping
keep // in source paths sources and originalPositionFor().source would change for valid maps, and callers look sources up by those strings

The other two todos are fixed without breaking anyone, in #135 (negative generated column) and #137 (negative original line or column). They keep a plain { todo: true } here, so this PR doesn't touch them. The non-string file and sourcesContent todos were first fixed in #134 and #138, but both fixes made other calls throw (rows above), so those PRs are closed and the todos are marked here instead. Two lock-in tests pin what they would have broken: sourceContentFor() returns a non-string entry, also on an index map, and applySourceMap() without a source file runs for a non-string file. Each fails with its closed PR's change, with a message saying that the fix needs a major release. The closed PRs' other tests stay on their branches for the major.

#118 tracks the breaking typings changes only, so these aren't linked there yet.

Tests only, so no changeset.

Ten of the conformance todos can't be fixed without changing results for
source maps that work today, or making some of them throw. They're now
created with major(reason), which makes the test a todo whose reason starts
with "needs a major release:" and says what the fix would change. The test
runner prints it next to the test.

The other four todos are fixed without breaking anyone in their own PRs.
The header said a fix needs a major release when it changes results for
source maps that work today. But the patch fixes change results for
invalid maps that work today too. It now names the three reasons: results
change for valid maps, maps that load today would throw, or leniency that
tools rely on goes away.
Reading a `file` or a `sourcesContent` entry that isn't a string as null
makes other calls throw for maps that work today:

- applySourceMap() without a source file throws "Both were omitted" for a
  consumer whose `file` is null, where it ran with `file: 42`.
- An index map's sourceContentFor() throws for a source whose content is
  null, unless asked to return null, where it returned the value.

So both wait for a major release too, and only the two todos for negative
positions are left for patch fixes.
#134 and
#138 read them as null, as the
spec does, and were closed because other calls then throw for maps that
work today. Two lock-in tests now pin the current results, and the calls
that would throw:

- a non-string sourcesContent entry is returned by sourceContentFor(), also
  on an index map, where null would make it throw;
- a non-string file is kept, and applySourceMap() without a source file
  runs, where null would make it throw.

Each fails with its closed PR's change and says that the fix needs a major
release.
@7rulnik
7rulnik marked this pull request as ready for review November 29, 2026 21:29
@7rulnik
7rulnik merged commit 523d228 into main Nov 29, 2026
7 checks passed
@7rulnik
7rulnik deleted the test/major-todos branch November 29, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant