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

non-ASCII characters in variable names get formatted incorrectly #71

Closed
tp opened this issue Jul 10, 2013 · 2 comments · Fixed by #144
Closed

non-ASCII characters in variable names get formatted incorrectly #71

tp opened this issue Jul 10, 2013 · 2 comments · Fixed by #144

Comments

@tp
Copy link

tp commented Jul 10, 2013

This just happened with the latest release:

Before:

var x = {
  ärgerlich: true
};

var ಠ_ಠ = "hi";

After:

var x = {ä
  rgerlich: true
};

varಠ _ಠ = "hi";
@espinielli
Copy link

Yes, I have a similar case.
The following code:

(function() {
    var ε = 1e-6,
    ε2 = ε * ε,
 π = Math.PI,
    sqrtπ = Math.sqrt(π),
  radians = π/ 180,
    degrees = 180 /π;
    return this;
})();

is indented like follows:

(function() {
    varε = 1e-6,
        ε2 = ε * ε,
        π = Math.PI,
        sqrtπ = Math.sqrt(π),
        radians = π/ 180,
    degrees = 180 /π;
    return this;
})();

The real problem is that the whitespace between var and ε disappears and what was vars become global!
(I guess the problem is the underlying jsBeautifier...)

@bitwiseman
Copy link
Collaborator

@jdc0589, this is fixed.

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

Successfully merging a pull request may close this issue.

4 participants