[Pkg-javascript-commits] [node-acorn-jsx] 24/484: Stricter lineBreak regexp

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:19:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit bb6687e3d13be8bb406d7ce498eba96b12636c6d
Author: Mathieu 'p01' Henri <mathieu at p01.org>
Date:   Wed Oct 3 12:02:27 2012 +0300

    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 b390cd7..a29d11f 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.
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list