aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/compress.js b/lib/compress.js
index f63c1869..a92ad97d 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -8581,17 +8581,17 @@ merge(Compressor.prototype, {
break;
case "charAt":
if (self.args.length < 2) {
- var node = make_node(AST_Sub, self, {
- expression: exp.expression,
- property: self.args.length ? make_node(AST_Binary, self.args[0], {
- operator: "|",
- left: make_node(AST_Number, self, {
- value: 0
- }),
- right: self.args[0]
- }) : make_node(AST_Number, self, {
- value: 0
- })
+ var node = make_node(AST_Binary, self, {
+ operator: "||",
+ left: make_node(AST_Sub, self, {
+ expression: exp.expression,
+ property: self.args.length ? make_node(AST_Binary, self.args[0], {
+ operator: "|",
+ left: make_node(AST_Number, self, { value: 0 }),
+ right: self.args[0],
+ }) : make_node(AST_Number, self, { value: 0 }),
+ }).optimize(compressor),
+ right: make_node(AST_String, self, { value: "" }),
});
node.is_string = return_true;
return node.optimize(compressor);