aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-28 10:51:08 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-02-28 10:51:08 -0500
commit39f68160b61b0d358edf36bfb220486da79909d8 (patch)
treec2f71d408e1ee6fd2f8738959e56730c9ccfa466 /src
parent8060d8fc693eae4a65ae2efe1ef5ca6cfe3c0636 (diff)
translate undef to 0 in toNiceIdent, so it never gets emitted as an identifier
Diffstat (limited to 'src')
-rw-r--r--src/parseTools.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 117c4987..f139cc3f 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -78,6 +78,7 @@ function toNiceIdent(ident) {
assert(ident);
if (parseFloat(ident) == ident) return ident;
if (ident == 'null') return '0'; // see parseNumerical
+ if (ident == 'undef') return '0';
return ident.replace('%', '$').replace(/["&\\ \.@:<>,\*\[\]\(\)-]/g, '_');
}