Skip to content

Commit

Permalink
fixup! Extract isPatternNext helper from isQuantifierNext
Browse files Browse the repository at this point in the history
Use `new` with RegExp constructor, as is done everywhere else.
  • Loading branch information
josephfrazier committed Mar 28, 2017
1 parent 68abf55 commit 5d8716e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/xregexp.js
Expand Up @@ -332,7 +332,7 @@ function isPatternNext(pattern, pos, flags, needlePattern) {
// Ignore any leading inline comments
[inlineCommentPattern];
return nativ.test.call(
RegExp('^(?:' + patternsToIgnore.join('|') + ')*(?:' + needlePattern + ')'),
new RegExp('^(?:' + patternsToIgnore.join('|') + ')*(?:' + needlePattern + ')'),
pattern.slice(pos)
);
}
Expand Down
2 changes: 1 addition & 1 deletion xregexp-all.js
Expand Up @@ -2983,7 +2983,7 @@ function isPatternNext(pattern, pos, flags, needlePattern) {
// Ignore any leading inline comments
[inlineCommentPattern];
return nativ.test.call(
RegExp('^(?:' + patternsToIgnore.join('|') + ')*(?:' + needlePattern + ')'),
new RegExp('^(?:' + patternsToIgnore.join('|') + ')*(?:' + needlePattern + ')'),
pattern.slice(pos)
);
}
Expand Down

0 comments on commit 5d8716e

Please sign in to comment.