[Pkg-javascript-commits] [uglifyjs] 83/190: Add test case for line continuation
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Aug 7 23:17:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.
commit 88b77ddaa9d6b3d55e537dc21030ac58ddfcb86e
Author: Anthony Van de Gejuchte <anthonyvdgent at gmail.com>
Date: Wed Jan 13 00:30:32 2016 +0100
Add test case for line continuation
---
test/mocha/string-literal.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/test/mocha/string-literal.js b/test/mocha/string-literal.js
index 6493363..84aaad7 100644
--- a/test/mocha/string-literal.js
+++ b/test/mocha/string-literal.js
@@ -14,16 +14,21 @@ describe("String literals", function() {
var test = function(input) {
return function() {
var ast = UglifyJS.parse(input);
- }
+ };
};
var error = function(e) {
return e instanceof UglifyJS.JS_Parse_Error &&
- e.message === "Unterminated string constant"
+ e.message === "Unterminated string constant";
};
for (var input in inputs) {
assert.throws(test(inputs[input]), error);
}
});
+
+ it("Should not throw syntax error if a string has a line continuation", function() {
+ var output = UglifyJS.parse('var a = "a\\\nb";').print_to_string();
+ assert.equal(output, 'var a="ab";');
+ });
});
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list