// typeof always returns a non-empty string, thus it's
// always true in booleans
AST_Node.warn("Boolean expression always true [{file}:{line},{col}]", self.start);
- return (exp instanceof AST_SymbolRef ? make_node(AST_True, self) : make_sequence(self, [
+ return (exp instanceof AST_SymbolRef && all(exp.definition().orig, function(sym) {
+ return !(sym instanceof AST_SymbolConst || sym instanceof AST_SymbolLet);
+ }) ? make_node(AST_True, self) : make_sequence(self, [
exp,
make_node(AST_True, self)
])).optimize(compressor);
mangle: test.mangle
});
var actual = stdout[toplevel ? 1 : 0];
- if (test.expect_stdout === true) {
+ if (test.expect_stdout === true || test.expect_stdout instanceof Error && test.expect_stdout.name === actual.name) {
test.expect_stdout = actual;
}
if (!sandbox.same_stdout(test.expect_stdout, actual)) {