🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

regjsparser

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regjsparser - npm Package Compare versions

Comparing version

to
0.8.2

2

package.json
{
"name": "regjsparser",
"version": "0.8.1",
"version": "0.8.2",
"author": "'Julian Viereck' <julian.viereck@gmail.com>",

@@ -5,0 +5,0 @@ "license": "BSD-2-Clause",

@@ -854,12 +854,2 @@ // regjsparser

if (hasUnicodeFlag) {
if (res = matchReg(/^\d/)) {
if (res[0] !== "0" || (res = matchReg(/^\d/)) ) {
bail("Invalid decimal escape in unicode mode", null, from, pos);
}
return createEscaped('null', 0x0000, '0', 1);
}
return false;
}
if (res = matchReg(/^(?!0)\d+/)) {

@@ -882,2 +872,12 @@ match = res[0];

// \1 octal escapes are disallowed in unicode mode, but they might
// be references to groups which haven't been parsed yet.
// We must parse a second time to determine if \1 is a reference
// or an octal scape, and then we can report the error.
if (firstIteration) {
shouldReparse = true;
} else {
bailOctalEscapeIfUnicode(from, pos);
}
// Reset the position again, as maybe only parts of the previous

@@ -909,2 +909,5 @@ // matched numbers are actual octal numbers. E.g. in '019' only

match = res[0];
if (match !== '0') {
bailOctalEscapeIfUnicode(from, pos);
}
if (/^0{1,3}$/.test(match)) {

@@ -920,2 +923,8 @@ // If they are all zeros, then only take the first one.

function bailOctalEscapeIfUnicode(from, pos) {
if (hasUnicodeFlag || hasUnicodeSetFlag) {
bail("Invalid decimal escape in unicode mode", null, from, pos);
}
}
function parseCharacterClassEscape() {

@@ -1507,2 +1516,3 @@ // CharacterClassEscape :: one of d D s S w W

var firstIteration = true;
var shouldReparse = false;
var hasUnicodeFlag = (flags || "").indexOf("u") !== -1;

@@ -1540,9 +1550,10 @@ var hasUnicodeSetFlag = (flags || "").indexOf("v") !== -1;

// SEE: https://github.com/jviereck/regjsparser/issues/70
for (var i = 0; i < backrefDenied.length; i++) {
if (backrefDenied[i] <= closedCaptureCounter) {
// Parse the input a second time.
pos = 0;
firstIteration = false;
return parseDisjunction();
}
shouldReparse = shouldReparse || backrefDenied.some(function (ref) {
return ref <= closedCaptureCounter;
});
if (shouldReparse) {
// Parse the input a second time.
pos = 0;
firstIteration = false;
return parseDisjunction();
}

@@ -1549,0 +1560,0 @@