regjsparser
Advanced tools
Comparing version
{ | ||
"name": "regjsparser", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"author": "'Julian Viereck' <julian.viereck@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "BSD-2-Clause", |
@@ -320,5 +320,5 @@ // regjsparser | ||
return createValue( | ||
'symbol', | ||
(first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, | ||
pos - 2, pos); | ||
'symbol', | ||
(first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, | ||
pos - 2, pos); | ||
} | ||
@@ -825,2 +825,4 @@ } | ||
skip(":"); | ||
var modifiersGroup = finishGroup("ignore", from); | ||
@@ -1239,20 +1241,20 @@ | ||
if (!('codePoint' in atom) || !('codePoint' in atomTo)) { | ||
if (!isUnicodeMode) { | ||
// If not, don't create a range but treat them as | ||
// `atom` `-` `atom` instead. | ||
// | ||
// SEE: https://tc39.es/ecma262/#sec-regular-expression-patterns-semantics | ||
// NonemptyClassRanges::ClassAtom-ClassAtomClassRanges | ||
// CharacterRangeOrUnion | ||
res = [atom, dash, atomTo]; | ||
} else { | ||
// With unicode flag, both sides must have codePoints if | ||
// one side has a codePoint. | ||
// | ||
// SEE: https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors | ||
// NonemptyClassRanges :: ClassAtom - ClassAtom ClassRanges | ||
bail('invalid character class'); | ||
} | ||
if (!isUnicodeMode) { | ||
// If not, don't create a range but treat them as | ||
// `atom` `-` `atom` instead. | ||
// | ||
// SEE: https://tc39.es/ecma262/#sec-regular-expression-patterns-semantics | ||
// NonemptyClassRanges::ClassAtom-ClassAtomClassRanges | ||
// CharacterRangeOrUnion | ||
res = [atom, dash, atomTo]; | ||
} else { | ||
// With unicode flag, both sides must have codePoints if | ||
// one side has a codePoint. | ||
// | ||
// SEE: https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors | ||
// NonemptyClassRanges :: ClassAtom - ClassAtom ClassRanges | ||
bail('invalid character class'); | ||
} | ||
} else { | ||
res = [createClassRange(atom, atomTo, from, to)]; | ||
res = [createClassRange(atom, atomTo, from, to)]; | ||
} | ||
@@ -1259,0 +1261,0 @@ |
1662
0.06%65689
-0.07%