Repository navigation
test: import syntax from the library in the tokenizer partition test - #6949
Merged
Merged
Conversation
#6932 moved syntax colouring out of the package API into runtime/lib/syntax-tokens.js, a public kernel entry, but test_shell_commands_share_colors_in_plain_code_widgets_and_diffs still read `syntax` from window.__lfWidgetApi(), so every call threw "syntax is not a function". The render harness now exposes window.__lfLibImport beside __lfVendorImport, and the test's two direct calls import `syntax` through it. The behavior the test protects (tokens partition the source exactly in every registered language) is unchanged. Closes #6948
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.
#6932 moved syntax colouring out of the package API into the library (
browser/runtime/lib/syntax-tokens.js, listed as a public kernel entry inkernel-registry.json), buttest_shell_commands_share_colors_in_plain_code_widgets_and_diffsstill readsyntaxfromwindow.__lfWidgetApi(). Every call threwTypeError: syntax is not a function, socion main went red (run 45313963639, the only failure among 7,916 tests). The test changed nothing else about what it checks: in every language the registry lists, the tokens must add up to the exact source. Browser tests don't run on pull requests unless the PR edits them, so #6932 merged green.The render harness now exposes
window.__lfLibImport(name)next to__lfVendorImport. It resolves against the same compiled entry base, and the test's two directsyntaxcalls import through it. No other test pulls one of the ten names #6932 moved (syntax,syntaxNow,synNodes,codeLanguage,ensureSyntaxLanguage,tokenLines,actionTemplate,iconTemplate,tally,tallyWords) from the package API.Verification: on main at
4660b588ethe test fails by node id; with this change it passes.Closes #6948 — automated triage