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.
Fixes: #971
This is a perfect example of putting too many statements into a
try-catch block. My bad. I was trying to keep the code simple, but it
bit us here.
This happens because we were using IS_PRODUCTION, but the order of the
consts at the top are:
const IS_PORTABLE = isPortable()
const IS_PRODUCTION = isProduction()
So we're inside of isPortable() and referring to IS_PRODUCTION before
it's defined. This should have thrown an exception, but it was caught by
the try-catch block.
Also, even after moving it out of the try-catch block, it still doesn't throw
an exception because we're transforming to ES5, so the consts are
changed to vars.
Also, standard should have caught this, but there's this bug standard/standard#636 that is preventing
us from enabling the
use-before-define
rule. Will hopefully be fixedsoon.
Basically, a perfect storm.