Permalink
Browse files

Don't use \xYY for identifiers

Fix #173
  • Loading branch information...
1 parent 81f5efe commit a869b854fa8a47b574f8ffbab882241ac04de70c @mishoo committed Mar 31, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/output.js
View
@@ -69,10 +69,10 @@ function OutputStream(options) {
var current_pos = 0;
var OUTPUT = "";
- function to_ascii(str) {
+ function to_ascii(str, identifier) {
return str.replace(/[\u0080-\uffff]/g, function(ch) {
var code = ch.charCodeAt(0).toString(16);
- if (code.length <= 2) {
+ if (code.length <= 2 && !identifier) {
while (code.length < 2) code = "0" + code;
return "\\x" + code;
} else {
@@ -114,7 +114,7 @@ function OutputStream(options) {
function make_name(name) {
name = name.toString();
if (options.ascii_only)
- name = to_ascii(name);
+ name = to_ascii(name, true);
return name;
};

0 comments on commit a869b85

Please sign in to comment.