@@ -260,6 +260,15 @@ function OutputStream(options) {
|
||||
|
||||
var require_semicolon = makePredicate("( [ + * / - , .");
|
||||
|
||||
function require_space(prev, ch, str) {
|
||||
return is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\")
|
||||
|| (ch == "/" && ch == prev)
|
||||
|| ((ch == "+" || ch == "-") && ch == last)
|
||||
|| last == "--" && ch == ">"
|
||||
|| last == "!" && str == "--"
|
||||
|| prev == "/" && (str == "in" || str == "instanceof");
|
||||
}
|
||||
|
||||
var print = options.beautify
|
||||
|| options.comments
|
||||
|| options.max_line_len
|
||||
@@ -312,12 +321,7 @@ function OutputStream(options) {
|
||||
}
|
||||
|
||||
if (might_need_space) {
|
||||
if (is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\")
|
||||
|| (ch == "/" && ch == prev)
|
||||
|| ((ch == "+" || ch == "-") && ch == last)
|
||||
|| str == "--" && last == "!"
|
||||
|| str == "in" && prev == "/"
|
||||
|| last == "--" && ch == ">") {
|
||||
if (require_space(prev, ch, str)) {
|
||||
output += " ";
|
||||
current_col++;
|
||||
}
|
||||
@@ -355,14 +359,7 @@ function OutputStream(options) {
|
||||
}
|
||||
}
|
||||
if (might_need_space) {
|
||||
if (is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\")
|
||||
|| (ch == "/" && ch == prev)
|
||||
|| ((ch == "+" || ch == "-") && ch == last)
|
||||
|| str == "--" && last == "!"
|
||||
|| str == "in" && prev == "/"
|
||||
|| last == "--" && ch == ">") {
|
||||
output += " ";
|
||||
}
|
||||
if (require_space(prev, ch, str)) output += " ";
|
||||
if (prev != "<" || str != "!") might_need_space = false;
|
||||
}
|
||||
output += str;
|
||||
@@ -1819,9 +1816,6 @@ function OutputStream(options) {
|
||||
case "\u2029": return "\\u2029";
|
||||
}
|
||||
}));
|
||||
var p = output.parent();
|
||||
if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === this)
|
||||
output.print(" ");
|
||||
});
|
||||
|
||||
function force_statement(stat, output) {
|
||||
|
||||
Reference in New Issue
Block a user