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.
This commit is contained in:
parent
7feb14c0ea
commit
bb6687e3d1
2
acorn.js
2
acorn.js
@ -338,7 +338,7 @@
|
|||||||
// Matches a whole line break (where CRLF is considered a single
|
// Matches a whole line break (where CRLF is considered a single
|
||||||
// line break). Used to count lines.
|
// 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.
|
// Test whether a given character code starts an identifier.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user