// here because they are only used in an equality comparison later on.
self.condition = negated;
var tmp = self.body;
- self.body = self.alternative || make_node(AST_EmptyStatement);
+ self.body = self.alternative || make_node(AST_EmptyStatement, self);
self.alternative = tmp;
}
if (is_empty(self.body) && is_empty(self.alternative)) {
case "Boolean":
if (self.args.length == 0) return make_node(AST_False, self);
if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
- expression: make_node(AST_UnaryPrefix, null, {
+ expression: make_node(AST_UnaryPrefix, self, {
expression: self.args[0],
operator: "!"
}),
compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
return make_node(AST_Seq, self, {
car: self.left,
- cdr: make_node(AST_False)
+ cdr: make_node(AST_False, self)
}).optimize(compressor);
}
if (ll.length > 1 && ll[1]) {
function string_template(text, props) {
return text.replace(/\{(.+?)\}/g, function(str, p){
- return props[p];
+ return props && props[p];
});
};