Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global variables #17

Open
sp00n opened this issue Jul 8, 2014 · 0 comments
Open

Global variables #17

sp00n opened this issue Jul 8, 2014 · 0 comments

Comments

@sp00n
Copy link

sp00n commented Jul 8, 2014

You have a few variables in your files that pollute the global namespace:
currentproperties, idx, key, mozFilter, msFilter, oFilter and webkitFilter all show up in the global DOM list.

Also, the cssParser.js file you're using uses A LOT of global variables for its internal logic, which seems kind of superflous. I haven't done any extensive testing (besides Firefox and Chrome), but I've simply put everything except the CSSScanner and CSSParser functions inside a self-executing anonymous function, and it seems to work for the time being (see above). There are certainly better ways though.
Maybe even some revised libraries for this, but I couldn't find the original code with a quick search for "cssparser js mozilla".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant