Skip to content

Commit 6a0f4ba

Browse files
committed
"build artefacts"
1 parent 6130280 commit 6a0f4ba

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

commonjs/compose-regexp.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@
110110
var tokenMatcher = /(\\.)|[-()|\[\]]((?=\?<?[=!]))?/g;
111111

112112

113-
var uProblemCharClassMatcher = /\\u(?:[0-9A-Fa-f]){4}|\\x(?:[0-9A-Fa-f]){2}|\\c[A-Za-z]|\\([^.?*+^$[\]\\(){}|\/DSWdswfnrtv-])|(\\[DSWdsw]-[^\]]|.-\\[DSWdsw])|\\.|\]/g;
113+
var uProblemCharClassMatcher = /\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\c[A-Za-z]|\\([^.?*+^$[\]\\(){}|\/DSWdswfnrtv-])|(\\[DSWdsw]-[^\]]|.-\\[DSWdsw])|\\.|\]/g;
114114

115115

116-
var uProblemDefaultMatcher = /\\u(?:[0-9A-Fa-f]){4}|\\x(?:[0-9A-Fa-f]){2}|\\c[A-Za-z]|\\k<(.*?)>|\\([^.?*+^$[\]\\(){}|\/DSWdswBbfnrtv])|\\.|\.|\[\^\]|\[|(\((?:\?[^])?)|(\)(?:[+?*]|\{\d+,?\d*\})?)/g;
116+
var uProblemDefaultMatcher = /\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\c[A-Za-z]|\\k<(.*?)>|\\([^.?*+^$[\]\\(){}|\/DSWdswBbfnrtv])|\\.|\.|\[\^\]|\[|(\((?:\?[^])?)|(\)(?:[+?*]|\{\d+,?\d*\})?)/g;
117117

118118
// General notes:
119119
//
@@ -396,11 +396,15 @@
396396
if (!inCClass) {
397397
if (refIndex != null) {
398398
var fixedRefIndex = (Number(refIndex) + count);
399-
if (fixedRefIndex > 99) throw new RangeError("Too many back references")
399+
if (fixedRefIndex > 99) throw new RangeError("Back reference index larger than 99")
400400

401401
return '\\' + String(fixedRefIndex)
402402
} else if (depth != null) {
403-
if (depth === '0') return '\\' + String(thunkIndex)
403+
if (depth === '0') {
404+
var fixedRefIndex = Number(thunkIndex) + initialOffset;
405+
if (fixedRefIndex > 99) throw new RangeError("Back reference index larger than 99")
406+
return '\\' + String(fixedRefIndex)
407+
}
404408
else return '$d:' + (Number(depth) -1) + ',n:' + thunkIndex + '^'
405409
}
406410
}
@@ -554,7 +558,6 @@
554558
// used for adding groups, assertions and quantifiers
555559

556560
function decorate(x, options) {
557-
// console.log({x, options})
558561
if(!options.condition || options.condition(x)) x.source = options.open + (x.source || '') + ')';
559562
if (options.suffix) x.source += options.suffix;
560563
return x
@@ -579,7 +582,6 @@
579582
// The recursive brain of compose-regexp
580583

581584
function assemble(patterns, either, contextRequiresWrapping, initialCapIndex) {
582-
// console.log({patterns})
583585
// this and [1] below could probably be simplified
584586
contextRequiresWrapping = contextRequiresWrapping || patterns.length > 1;
585587
return map.call(patterns, function processItem(item) {
@@ -616,8 +618,6 @@
616618
}
617619

618620
function finalize(x, options) {
619-
// console.trace({x})
620-
// const {flags, direction} = options
621621
options = options || {};
622622
var flags = hasOwn.call(options, 'flags') ? options.flagsOp(getFlags(), options.flags) : getFlags();
623623
var either = options.either;

0 commit comments

Comments
 (0)