From bb6687e3d13be8bb406d7ce498eba96b12636c6d Mon Sep 17 00:00:00 2001 From: Mathieu 'p01' Henri Date: Wed, 3 Oct 2012 12:02:27 +0300 Subject: [PATCH] Stricter lineBreak regexp Checking for `\r\n?` is redundant with the `|[\n\r\u2028\u2029]`, better straighten the regexp and check for `\r\n|[\n\r\u2028\u2029]`. This might even be a itsy bitsty bit faster. --- acorn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index b390cd7aa0..a29d11fe20 100644 --- a/acorn.js +++ b/acorn.js @@ -338,7 +338,7 @@ // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. - var lineBreak = /\r\n?|[\n\r\u2028\u2029]/g; + var lineBreak = /\r\n|[\n\r\u2028\u2029]/g; // Test whether a given character code starts an identifier.