Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlms13/static-compat
Static code analyzer to check for unsupported browser features
https://github.com/mlms13/static-compat
Last synced: 25 days ago
JSON representation
Static code analyzer to check for unsupported browser features
- Host: GitHub
- URL: https://github.com/mlms13/static-compat
- Owner: mlms13
- Created: 2015-03-02T22:20:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-02T22:20:17.000Z (over 9 years ago)
- Last Synced: 2024-04-15T12:13:24.857Z (7 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compatibilityify (or, Compatibilibuddy?)
## The Why
When supporting old browsers, we often run into third-party libraries that aren't as thorough in their browser support as we'd like to be. This tool reads JavaScript input and checks against a list of features that are known not to work in certain browsers. It returns errors, warnings, and suggested fixes when scripts attempt to do things that will make our supported browsers sad.
## The How
A JavaScript input file is parsed by [Esprima](http://esprima.org/). Then, we traverse the AST produced by Esprima and normalize variable types, so that we can run the appropriate "Support Tests" against each item in the syntax tree.
## The Anatomy of a Support Test
Each support test requires its own set of browser support data.
### Support Data
...
## Testing the Tests
Support tests are worthless if they are inaccurate. The dynamic nature of JavaScript types mean that edge cases are everywhere, and complete unit tests are critical.
Thorough tests exist to protect against both false positives and false negatives. If you encounter an edge case that isn't currently being tested against, please add a failing test, even if you don't have the code to fix the test.