-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[[FIX]] Do not require global USD for any envs
In web browsers, enabling ES5 "strict mode" at a global level effects all scripts executed in the same context. For this reason, the `strict` option was originally implemented to enforce the directive's use in function scope only. However: the Browserify, Node.js, and PhantomJS environments do not suffer from this problem. Recent improvements to the option's behavior included making JSHint's interpretation of `strict: true` to be contextual: in those environments where a global `use strict` directive is "safe," enabling the option would require the global directive. Although this change is an improvement (because it encourages more code to be written in strict mode), it is backwards incompatible. Moreover, the option's documentation in JSHint 2.8.0 explicitly described the sub-optimal behavior: > *Note:* This option enables strict mode for function scope only. It > *prohibits* the global scoped strict mode because it might break > third-party widgets on your page. If you really want to use global > strict mode, see the *globalstrict* option. For this reason, `strict: true` should continue to trigger the "legacy" behavior. The change brings that configuration completely in-line with the recently-introduced `strict: func`, and because `strict: func` has not been released in a stable version, it can safely be removed.
- Loading branch information
1 parent
cfe6c43
commit 3fa9ece
Showing
4 changed files
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters