From 916faf0a486fb540273629ef6c80d1087d1fd4ae Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 6 Feb 2013 11:57:59 +0200 Subject: [PATCH] Force space after literal regexp when used in "instanceof" or "in" Close #118 --- lib/output.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/output.js b/lib/output.js index b33bc63408c..42b3aad9279 100644 --- a/lib/output.js +++ b/lib/output.js @@ -1081,6 +1081,9 @@ function OutputStream(options) { if (output.option("ascii_only")) str = output.to_ascii(str); output.print(str); + var p = output.parent(); + if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self) + output.print(" "); }); function force_statement(stat, output) {