aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-03-31 13:35:29 +0300
committerMihai Bazon <mihai@bazon.net>2013-03-31 13:36:22 +0300
commita869b854fa8a47b574f8ffbab882241ac04de70c (patch)
tree29f489742cee281bbdaf08b7e68a5e3fe6aa80d5 /lib
parent81f5efe39a6d44d3037dda8bcff01195f5699139 (diff)
downloadtracifyjs-a869b854fa8a47b574f8ffbab882241ac04de70c.tar.gz
tracifyjs-a869b854fa8a47b574f8ffbab882241ac04de70c.zip
Don't use \xYY for identifiers
Fix #173
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/output.js b/lib/output.js
index b99bfa63..04b20708 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -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;
};