I'm wondering if there is a static checker that will look at my javascript sources and tell me which native functions I should not use or use differently if I want my scripts to work across browsers.
For example Chrome does not know String.contains()
but Firefox does. I would want to be warned that I should avoid String.contains()
completely.
Another example would be the usage of Array.sort()
, which only works correctly across browsers if your compare function returns a Number
. All browsers will also accept boolean
values but not behave consistently in this case. A warning about the return type would be great. (Analysis would be much more complex and maybe not even possible.)
Does somebody know about a static checker that warns about "non-ECMA" usage of native functions. I searched but did not find anything.