diff options
author | Mihai Bazon <mihai@bazon.net> | 2013-02-06 11:57:59 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2013-02-06 11:57:59 +0200 |
commit | 916faf0a486fb540273629ef6c80d1087d1fd4ae (patch) | |
tree | 378959e76647ede616dd4bd17f9d05d29eafb83e /lib | |
parent | f36e4e9a785e9c1d5bc6212589aa745f5ef487c0 (diff) | |
download | tracifyjs-916faf0a486fb540273629ef6c80d1087d1fd4ae.tar.gz tracifyjs-916faf0a486fb540273629ef6c80d1087d1fd4ae.zip |
Force space after literal regexp when used in "instanceof" or "in"
Close #118
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js index b33bc634..42b3aad9 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) { |