You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can guess at the motivation here: in strict mode code, assignment to an
unresolvable reference throws a ReferenceError (outside of strict mode, such
assignments silently create global bindings). The author of this code was
likely trying to help users avoid the ReferenceError.
Unfortunately (and as implied by this bug report), we cannot determine which
global references are unresolvable statically.
The reason I like this behavior is that it encourages people to enable "undef",
which in turn forces them to be explicit about global variables. I'll be sad to
see it go, but it seems as though we may have to remove it.
@mkrogius The short-term solution for you is to formally declare all global
variables--either in the script itself, or by explicitly configuring JSHint
with the globals configuration option.
See previous issue #353
Gives an error: 'a' is not defined.
The text was updated successfully, but these errors were encountered: