-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
support dumping AST #1879
support dumping AST #1879
Conversation
closes mishoo#769
bin/uglifyjs
Outdated
|
||
function skip_key(key) { | ||
switch (key) { | ||
case "cname": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change this to:
var skip_keys = [ "cname", "enclosed", ... ];
function skip_key(key) { return skip_keys.indexOf(key) >= 0; }
as it's more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you meant function skip_key(...
? 😮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. corrected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 4116731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect.
Wow - nice. Far simpler implementation than the dump AST patch. |
I cheat by utilising the recursive nature of |
This will make debugging infinitely easier. |
@kzc reading your patch at #769 (comment) again, I noticed I've missed reordering of |
Improve readability of JSON dump.
Thanks. Makes it much easier to read the AST output. |
Something is not quite right with the latest version of this PR:
Would you mind adding at least one AST dump mocha test? |
This is a workaround for the bug above:
|
That's one strange bug indeed - let me investigate, then put in a quick Edit: yeah, I'm being an idiot... |
add mocha test
Should be fixed by 1040110, alongside a |
Odd - why would moving the |
Reading from The previous version of this PR also works because it does not contain |
Thanks. It's obvious in hindsight. |
This feature works great - best thing since sliced bread. |
closes #769
#1878 (comment)