aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 7297938a..a16c9a69 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -619,7 +619,15 @@ merge(Compressor.prototype, {
if (node.key instanceof AST_Node) node.key.walk(tw);
fixed = function() {
var key = node.key;
- return make_node(typeof key == "string" ? AST_Dot : AST_Sub, node, {
+ var type = AST_Sub;
+ if (typeof key == "string") {
+ if (is_identifier_string(key)) {
+ type = AST_Dot;
+ } else {
+ key = make_node_from_constant(key, node);
+ }
+ }
+ return make_node(type, node, {
expression: save(),
property: key
});