diff options
Diffstat (limited to 'test/mocha/operator.js')
-rw-r--r-- | test/mocha/operator.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mocha/operator.js b/test/mocha/operator.js index d36d3a1d..8dfea547 100644 --- a/test/mocha/operator.js +++ b/test/mocha/operator.js @@ -486,4 +486,19 @@ describe("operator", function() { assert.strictEqual(UglifyJS.parse(exp[0]).print_to_string(), exp[1] + ";"); }); }); + it("Should preserve space between /regex/ and `in`", function() { + [ + "/regex/ in {}", + "/regex/g in {}", + "0 + /regex/ in {}", + "0 + /regex/g in {}", + ].forEach(function(exp) { + var code = UglifyJS.parse(exp).print_to_string(); + try { + assert.strictEqual(UglifyJS.parse(code).print_to_string(), code); + } catch (ex) { + assert.fail("Failed to reparse: " + exp + "\n" + ex); + } + }); + }); }); |