From a97690fc724a7beba77d7fde449ea56676804933 Mon Sep 17 00:00:00 2001 From: Anthony Van de Gejuchte Date: Mon, 13 Jun 2016 12:36:47 +0200 Subject: Various LineTerminator changes * Escaped newlines should also produce SyntaxError * Fix multiline comment parsing and add tests * Adapt makePredicate to handle \u2028 and \u2029 * Move up nlb check in regex so it's checked before any escape handling * Change error messages to conform ecma standard * Find_eol not recornizing \u2028 and \u2029 as line terminator * Remove \u180e as it is removed in unicode 6.3.0 from the category zs --- test/mocha/line-endings.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/mocha/line-endings.js') diff --git a/test/mocha/line-endings.js b/test/mocha/line-endings.js index 3457dd70..ef46bccd 100644 --- a/test/mocha/line-endings.js +++ b/test/mocha/line-endings.js @@ -37,6 +37,10 @@ describe("line-endings", function() { "/\r/", "/\u2028/", "/\u2029/", + "/\\\n/", + "/\\\r/", + "/\\\u2028/", + "/\\\u2029/", "/someRandomTextLike[]()*AndThen\n/" ] var test = function(input) { @@ -46,7 +50,7 @@ describe("line-endings", function() { } var fail = function(e) { return e instanceof Uglify.JS_Parse_Error && - e.message === "Unexpected line terminator"; + e.message === "SyntaxError: Unexpected line terminator"; } for (var i = 0; i < inputs.length; i++) { assert.throws(test(inputs[i]), fail); -- cgit v1.2.3