Fixes to prepare generate-bytecode.js for ts-check #452
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.
I started to add jsdoc type annotations to generate-bytecode.js, and found a number of issues that typescript doesn't like. It seemed to make sense to fix those separately. But I can add the actual ts-check pull request (not yet submitted) to this one if you'd prefer.
Using
thing | 0
to produce an integer when thing could be undefinedmatch
field which is always one of -1, 0, 1 or undefined. Sothing || 0
does the same thing, and typescript is happy with it.Putting null into arrays that are supposed to contain numbers
literal
arrays, when thematch
field says that it won't be used. So using -1 is just as good.Using
Object.entries
withlib
set toES2015
ES2017
is universal enough, we could just bump thelib
version. With this diff I've gone with switching toObject.keys
.