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

Variables only matched once per scope #2

Open
nadinengland opened this issue Apr 7, 2013 · 4 comments
Open

Variables only matched once per scope #2

nadinengland opened this issue Apr 7, 2013 · 4 comments

Comments

@nadinengland
Copy link

Each variable is only matched once per function to its original scope:

Screen Shot 2013-04-07 at 11 01 21

As you can above, nested scoped seems to reset it.

This is awesome btw 👍

@daniellmb
Copy link
Owner

I've added a unit test for this, pull request welcome :)
http://daniellmb.github.io/JavaScript-Scope-Context-Coloring/test

@nadinengland
Copy link
Author

Here is what I've been able to ascertain so far. The bug isn't in the color function but rather as the expression is being parsed.

I've done some extensive testing with the color function and it does correctly break up the input based on the given scope level. So that's how I've determined the problem comes from earlier on in the pipeline.

@mazurov
Copy link

mazurov commented Apr 26, 2013

I found many bugs in JsLint scope coloring, so I've just shiped an alternative to jslint color: https://github.com/mazurov/eslevels. It based on esprima and escope libraries that support the latest javascript standards.

Web demo page: http://mazurov.github.io/eslevels-demo/

@daniellmb
Copy link
Owner

Nice work @mazurov! However, eslevels is not compatible with JSLint color API, so in its current form unfortunately it can't be swapped in.

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

No branches or pull requests

3 participants