Repository navigation
Mark the conformance todos that need a major release - #136
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Twelve of the 14 conformance todos in
test/test-ecma426-conformance.jscan'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 withneeds a major release:. node:test prints the reason next to the test:nullinsourcessourceswould holdnullfor valid maps, where callers expect only stringssourcesentrynamesentrysourcesContententrysourceContentFor()would throw for such a source, where it returns the value todayfileapplySourceMap()without a source file would throw for such a map, where it runs todaytoJSON()/toString()would throw for mappings they write (wrongly) todayBdecodes to -2^31Bwould decode to -2^31 instead of 0mappingsrejected//in source pathssourcesandoriginalPositionFor().sourcewould change for valid maps, and callers look sources up by those stringsThe 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-stringfileandsourcesContenttodos 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, andapplySourceMap()without a source file runs for a non-stringfile. 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.