Worker threads fixes and SourceMap revamp #1666
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.
Worker threads (
CIVET_THREADS
feature) was broken in a few ways:{}
exception if there was an errorerrors
option didn't properly modify the arrayyarn test
to fail (before Parallel testing viaCIVET_THREADS
(Mocha's--parallel
) #1665), and also causedcivet filename.civet
to fail. 🙀Internal API change:
SourceMap
is now aclass
. This seems cleaner overall, and helps with serialization for worker messages. But it changes the API:SourceMap(source)
we need to usenew SourceMap(source)
.lines
etc. are properties instead of part of thedata
field. In code that deals with multiple versions of Civet (e.g. LSP), I included a fallback for the old format.source
is now a property, not a function. I don't think we use it anywhere though.updateSourceMap
needs to bebind
edAlso the ESM register plugin tells you which file is erroring (which has been an issue in the past).
Also a small fix so that
CIVET_THREADS=0 yarn test
disables Mocha's parallel mode (to bypassexport CIVET_THREADS=4
). Previously0
was treated as truthy.BREAKING CHANGE: Must update VSCode plugin to 0.3.27 and eslint plugin to 0.0.6