Move most harness globals into namespaces #35530
Merged
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.
This way our transformation into modules doesn't need to attempt to preserve so many globals that we don't actually need as globals (since that preservation is really ugly).
Also now in this PR:
mapShim
no longer relies on forward declarations ofMap
and indeterminate resolution ofIterator
(neither fo these strategies work well with modules - it now has structural copies of both). Considering this removes a@ts-ignore
, this seems like an improvement.testRunner
to stub the namespaces fromharness
- surprisingly, this is the only layer where we use a namespace from another layer without redeclaring that namespace somewhere. Rather than creating special logic to handle this, adding a reference is easier.Utils
andutils
. This was problematic, as far as new filenames go. Now there's justUtils
.let
s in the harness/runner now have a setter (as alet
cannot be directly reassigned cross-module)ts.disableIncrementalParsing
is no more. It was alwaysfalse
in our own codebase (since Enable incremental parsing by default. #1568 - 5 years ago), and we had no tests where it was changed totrue
. Doing a codesearch on github seems to indicate it's not actually a used public API, so removing it seems fine. In a way, this is a fix for Compiler API - Make disableIncrementalParsing not a global variable #35158. This is done because, well, you can't present a mutable, assignable member like this, as a module. If the functionality was needed, it could be exposed through a setter, but in any case, the variable would be no more.