Comparing version 1.2.4 to 1.2.5
@@ -8,4 +8,15 @@ import { ParserState } from '../common'; | ||
} | ||
export declare const enum NumberKind { | ||
ImplicitOctal = 1, | ||
Binary = 2, | ||
Octal = 4, | ||
Hex = 8, | ||
Decimal = 16, | ||
DecimalWithLeadingZero = 32, | ||
Float = 64, | ||
DecimalNumberKind = 48, | ||
ValidBigIntKind = 62 | ||
} | ||
export declare function nextCP(parser: ParserState): number; | ||
export declare function consumeMultiUnitCodePoint(parser: ParserState, hi: number): boolean; | ||
export declare function consumeMultiUnitCodePoint(parser: ParserState, hi: number): 0 | 1; | ||
export declare function consumeLineFeed(parser: ParserState, lastIsCR: boolean): void; | ||
@@ -12,0 +23,0 @@ export declare function scanNewLine(parser: ParserState): void; |
export { scanSingleToken, nextToken } from './scan'; | ||
export { skipMultiLineComment, skipSingleLineComment, skipHashBang } from './comments'; | ||
export { nextCP, consumeMultiUnitCodePoint, isExoticECMAScriptWhitespace, fromCodePoint, toHex, consumeLineFeed, scanNewLine, LexerState } from './common'; | ||
export { nextCP, consumeMultiUnitCodePoint, isExoticECMAScriptWhitespace, fromCodePoint, toHex, consumeLineFeed, scanNewLine, LexerState, NumberKind } from './common'; | ||
export { CharTypes, CharFlags, isIdentifierStart, isIdentifierPart } from './charClassifier'; | ||
export { scanIdentifier, scanIdentifierSlowCase, scanUnicodeIdentifier, scanPrivateName, scanUnicodeEscapeValue } from './identifier'; | ||
export { scanString } from './string'; | ||
export { scanNumber, NumberKind } from './numeric'; | ||
export { scanNumber } from './numeric'; | ||
export { scanTemplate, scanTemplateTail } from './template'; | ||
export { scanRegularExpression } from './regexp'; | ||
//# sourceMappingURL=index.d.ts.map |
import { ParserState, Context } from '../common'; | ||
import { Token } from '../token'; | ||
export declare const enum NumberKind { | ||
ImplicitOctal = 1, | ||
Binary = 2, | ||
Octal = 4, | ||
Hex = 8, | ||
Decimal = 16, | ||
DecimalWithLeadingZero = 32 | ||
} | ||
export declare function scanNumber(parser: ParserState, context: Context, isFloat: 0 | 1): Token; | ||
import { NumberKind } from './'; | ||
export declare function scanNumber(parser: ParserState, context: Context, kind: NumberKind): Token; | ||
export declare function scanDecimalDigitsOrSeparator(parser: ParserState, char: number): string; | ||
//# sourceMappingURL=numeric.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { LexerState } from './'; | ||
import { Token } from '../token'; | ||
import { ParserState, Context } from '../common'; | ||
import { LexerState } from './'; | ||
export declare const TokenLookup: Token[]; | ||
@@ -5,0 +5,0 @@ export declare function nextToken(parser: ParserState, context: Context): void; |
@@ -9,3 +9,3 @@ import { ParserState, Context } from '../common'; | ||
} | ||
export declare function scanString(parser: ParserState, context: Context): any; | ||
export declare function scanString(parser: ParserState, context: Context, quote: number): any; | ||
export declare function parseEscape(parser: ParserState, context: Context, first: number): number; | ||
@@ -12,0 +12,0 @@ export declare function handleStringError(state: ParserState, code: Escape, isTemplate: 0 | 1): void; |
@@ -6,3 +6,3 @@ import { Options } from './parser'; | ||
export declare function parse(source: string, options: Options | void): ESTree.Program; | ||
export declare const version = "1.2.1"; | ||
export declare const version = "1.2.4"; | ||
//# sourceMappingURL=meriyah.d.ts.map |
{ | ||
"name": "meriyah", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "A 100% compliant, self-hosted javascript parser with high focus on both performance and stability", | ||
@@ -49,3 +49,3 @@ "main": "dist/meriyah.umd.js", | ||
"build:watch": "tsc -w", | ||
"lint": "cross-env tslint -p tsconfig.json -t stylish", | ||
"lint": "eslint \"{src,test,scripts}/**/*.{ts,js}\"", | ||
"prettier": "node ./scripts/prettier.js write-changed", | ||
@@ -66,5 +66,12 @@ "prettier-all": "node ./scripts/prettier.js write", | ||
"@types/node": "^12.0.10", | ||
"@typescript-eslint/eslint-plugin": "^1.11.0", | ||
"@typescript-eslint/parser": "^1.11.0", | ||
"chalk": "^2.4.2", | ||
"coveralls": "^3.0.4", | ||
"cross-env": "^5.2.0", | ||
"husky": "^2.4.1", | ||
"eslint": "^6.0.1", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-node": "^9.1.0", | ||
"glob": "^7.1.4", | ||
"husky": "^2.7.0", | ||
"mocha": "^6.1.4", | ||
@@ -75,3 +82,3 @@ "nyc": "^14.1.1", | ||
"rimraf": "^2.6.3", | ||
"rollup": "^1.16.2", | ||
"rollup": "^1.16.3", | ||
"rollup-plugin-replace": "^2.2.0", | ||
@@ -94,3 +101,6 @@ "rollup-plugin-terser": "^5.0.0", | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=10.0.0" | ||
} | ||
} |
@@ -337,2 +337,3 @@ import { ParserState } from './common'; | ||
public description: string; | ||
/*eslint-disable*/ | ||
constructor(startindex: number, line: number, column: number, type: Errors, ...params: string[]) { | ||
@@ -339,0 +340,0 @@ const message = |
@@ -24,2 +24,3 @@ interface _Node<T extends string> { | ||
} | ||
/*eslint-disable*/ | ||
interface _Expression<T extends string> extends _Node<T> {} | ||
@@ -186,3 +187,3 @@ interface T_Expression { | ||
| AwaitExpression; | ||
/*eslint-disable*/ | ||
export interface EmptyStatement extends _Node<'EmptyStatement'> {} | ||
@@ -271,3 +272,3 @@ | ||
} | ||
/*eslint-disable*/ | ||
interface _Statement<T extends string> extends _Node<T> {} | ||
@@ -300,8 +301,9 @@ interface T_Declaration { | ||
} | ||
/*eslint-disable*/ | ||
export interface DebuggerStatement extends _Node<'DebuggerStatement'> {} | ||
export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; | ||
/*eslint-disable*/ | ||
interface _Declaration<T extends string> extends _Statement<T> {} | ||
interface BaseDeclaration extends _Node<'ExpressionStatement'> {} | ||
@@ -352,2 +354,3 @@ export interface FunctionDeclaration extends _Declaration<'FunctionDeclaration'> { | ||
/*eslint-disable*/ | ||
export interface ThisExpression extends _Expression<'ThisExpression'> {} | ||
@@ -448,2 +451,3 @@ | ||
} | ||
/*eslint-disable*/ | ||
interface _Pattern<T extends string> extends _Node<T> {} | ||
@@ -526,2 +530,3 @@ | ||
/*eslint-disable*/ | ||
export interface Super extends _Node<'Super'> {} | ||
@@ -648,3 +653,3 @@ | ||
export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier; | ||
/*eslint-disable*/ | ||
interface _ModuleDeclaration<T extends string> extends _Node<T> {} | ||
@@ -658,4 +663,6 @@ export interface ImportDeclaration extends _ModuleDeclaration<'ImportDeclaration'> { | ||
} | ||
/*eslint-disable*/ | ||
export interface ImportDefaultSpecifier extends _ModuleSpecifier<'ImportDefaultSpecifier'> {} | ||
/*eslint-disable*/ | ||
export interface ImportNamespaceSpecifier extends _ModuleSpecifier<'ImportNamespaceSpecifier'> {} | ||
@@ -662,0 +669,0 @@ |
import { nextCP, CharTypes, CharFlags, LexerState, scanNewLine, consumeLineFeed } from './'; | ||
import { Chars } from '../chars'; | ||
import { ParserState, Context } from '../common'; | ||
import { ParserState } from '../common'; | ||
import { report, Errors } from '../errors'; | ||
@@ -13,3 +13,3 @@ | ||
// HashbangComment :: | ||
// #! SingleLineCommentChars | ||
// #! SingleLineCommentChars_opt | ||
if (parser.nextCP === Chars.Hash && parser.source.charCodeAt(parser.index + 1) === Chars.Exclamation) { | ||
@@ -16,0 +16,0 @@ skipSingleLineComment(parser, LexerState.None); |
@@ -13,2 +13,14 @@ import { Chars } from '../chars'; | ||
export const enum NumberKind { | ||
ImplicitOctal = 1 << 0, | ||
Binary = 1 << 1, | ||
Octal = 1 << 2, | ||
Hex = 1 << 3, | ||
Decimal = 1 << 4, | ||
DecimalWithLeadingZero = 1 << 5, | ||
Float = 1 << 6, | ||
DecimalNumberKind = Decimal | DecimalWithLeadingZero, | ||
ValidBigIntKind = Binary | Decimal | Hex | Octal | DecimalWithLeadingZero | ||
} | ||
/** | ||
@@ -23,8 +35,8 @@ * Advances this lexer's current index. | ||
export function consumeMultiUnitCodePoint(parser: ParserState, hi: number): boolean { | ||
export function consumeMultiUnitCodePoint(parser: ParserState, hi: number): 0 | 1 { | ||
// See: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type | ||
if ((hi & 0xfc00) !== Chars.LeadSurrogateMin) return false; | ||
if ((hi & 0xfc00) !== Chars.LeadSurrogateMin) return 0; | ||
const lo = parser.source.charCodeAt(parser.index + 1); | ||
if ((lo & 0xfc00) !== 0xdc00) return false; | ||
hi = Chars.NonBMPMin + ((hi & 0x3ff) << 10) + (lo & 0x3ff); | ||
if ((lo & 0xfc00) !== 0xdc00) return 0; | ||
hi = parser.nextCP = Chars.NonBMPMin + ((hi & 0x3ff) << 10) + (lo & 0x3ff); | ||
if (((unicodeLookup[(hi >>> 5) + 0] >>> hi) & 31 & 1) === 0) { | ||
@@ -35,4 +47,3 @@ report(parser, Errors.IllegalCaracter, fromCodePoint(hi)); | ||
parser.column++; | ||
parser.nextCP = hi; | ||
return true; | ||
return 1; | ||
} | ||
@@ -43,3 +54,3 @@ | ||
*/ | ||
export function consumeLineFeed(parser: ParserState, lastIsCR: boolean) { | ||
export function consumeLineFeed(parser: ParserState, lastIsCR: boolean): void { | ||
parser.nextCP = parser.source.charCodeAt(++parser.index); | ||
@@ -53,3 +64,3 @@ parser.flags |= Flags.NewLine; | ||
export function scanNewLine(parser: ParserState) { | ||
export function scanNewLine(parser: ParserState): void { | ||
parser.flags |= Flags.NewLine; | ||
@@ -56,0 +67,0 @@ parser.nextCP = parser.source.charCodeAt(++parser.index); |
@@ -7,3 +7,2 @@ import { ParserState, Context } from '../common'; | ||
import { report, reportAt, Errors } from '../errors'; | ||
import { unicodeLookup } from '../unicode'; | ||
@@ -10,0 +9,0 @@ /** |
@@ -11,3 +11,4 @@ export { scanSingleToken, nextToken } from './scan'; | ||
scanNewLine, | ||
LexerState | ||
LexerState, | ||
NumberKind | ||
} from './common'; | ||
@@ -23,4 +24,4 @@ export { CharTypes, CharFlags, isIdentifierStart, isIdentifierPart } from './charClassifier'; | ||
export { scanString } from './string'; | ||
export { scanNumber, NumberKind } from './numeric'; | ||
export { scanNumber } from './numeric'; | ||
export { scanTemplate, scanTemplateTail } from './template'; | ||
export { scanRegularExpression } from './regexp'; |
import { ParserState, Context, Flags } from '../common'; | ||
import { Token } from '../token'; | ||
import { nextCP, toHex, CharTypes, CharFlags, isIdentifierStart } from './'; | ||
import { nextCP, toHex, CharTypes, CharFlags, isIdentifierStart, NumberKind } from './'; | ||
import { Chars } from '../chars'; | ||
import { report, Errors } from '../errors'; | ||
export const enum NumberKind { | ||
ImplicitOctal = 1 << 0, | ||
Binary = 1 << 1, | ||
Octal = 1 << 2, | ||
Hex = 1 << 3, | ||
Decimal = 1 << 4, | ||
DecimalWithLeadingZero = 1 << 5 | ||
} | ||
/** | ||
@@ -23,14 +14,18 @@ * Scans numeric literal | ||
*/ | ||
export function scanNumber(parser: ParserState, context: Context, isFloat: 0 | 1): Token { | ||
let kind: NumberKind = NumberKind.Decimal; | ||
export function scanNumber(parser: ParserState, context: Context, kind: NumberKind): Token { | ||
// DecimalLiteral :: | ||
// DecimalIntegerLiteral . DecimalDigits_opt | ||
// . DecimalDigits | ||
let char = parser.nextCP; | ||
let value: any = 0; | ||
let digit = 9; | ||
let atStart = !isFloat; | ||
let atStart = kind & NumberKind.Float ? 1 : 0; | ||
let digits = 0; | ||
let allowSeparator: 0 | 1 = 0; | ||
if (isFloat) { | ||
if (kind & NumberKind.Float) { | ||
value = '.' + scanDecimalDigitsOrSeparator(parser, char); | ||
char = parser.nextCP; | ||
// It is a Syntax Error if the MV is not an integer. (dot decimalDigits) | ||
if (char === Chars.LowerN) report(parser, Errors.InvalidBigInt); | ||
} else { | ||
@@ -43,8 +38,6 @@ if (char === Chars.Zero) { | ||
kind = NumberKind.Hex; | ||
char = nextCP(parser); | ||
char = nextCP(parser); // skips 'X', 'x' | ||
while (CharTypes[char] & (CharFlags.Hex | CharFlags.Underscore)) { | ||
if (char === Chars.Underscore) { | ||
if (!allowSeparator) { | ||
report(parser, Errors.ContinuousNumericSeparator); | ||
} | ||
if (!allowSeparator) report(parser, Errors.ContinuousNumericSeparator); | ||
allowSeparator = 0; | ||
@@ -60,8 +53,9 @@ char = nextCP(parser); | ||
if (digits < 1) report(parser, Errors.MissingHexDigits); | ||
if (!allowSeparator) report(parser, Errors.TrailingNumericSeparator); | ||
if (digits < 1 || !allowSeparator) { | ||
report(parser, digits < 1 ? Errors.MissingHexDigits : Errors.TrailingNumericSeparator); | ||
} | ||
// Octal | ||
} else if ((char | 32) === Chars.LowerO) { | ||
kind = NumberKind.Octal; | ||
char = nextCP(parser); | ||
char = nextCP(parser); // skips 'X', 'x' | ||
while (CharTypes[char] & (CharFlags.Octal | CharFlags.Underscore)) { | ||
@@ -81,7 +75,8 @@ if (char === Chars.Underscore) { | ||
} | ||
if (digits < 1) report(parser, Errors.ExpectedNumberInRadix, `${8}`); | ||
if (!allowSeparator) report(parser, Errors.TrailingNumericSeparator); | ||
if (digits < 1 || !allowSeparator) { | ||
report(parser, digits < 1 ? Errors.MissingHexDigits : Errors.TrailingNumericSeparator); | ||
} | ||
} else if ((char | 32) === Chars.LowerB) { | ||
kind = NumberKind.Binary; | ||
char = nextCP(parser); | ||
char = nextCP(parser); // skips 'B', 'b' | ||
while (CharTypes[char] & (CharFlags.Binary | CharFlags.Underscore)) { | ||
@@ -101,4 +96,5 @@ if (char === Chars.Underscore) { | ||
} | ||
if (digits < 1) report(parser, Errors.ExpectedNumberInRadix, `${2}`); | ||
if (!allowSeparator) report(parser, Errors.TrailingNumericSeparator); | ||
if (digits < 1 || !allowSeparator) { | ||
report(parser, digits < 1 ? Errors.MissingHexDigits : Errors.TrailingNumericSeparator); | ||
} | ||
} else if (CharTypes[char] & CharFlags.Octal) { | ||
@@ -111,6 +107,6 @@ // Octal integer literals are not permitted in strict mode code | ||
kind = NumberKind.DecimalWithLeadingZero; | ||
atStart = false; | ||
atStart = 0; | ||
break; | ||
} | ||
value = value * 8 + (parser.nextCP - Chars.Zero); | ||
value = value * 8 + (char - Chars.Zero); | ||
char = nextCP(parser); | ||
@@ -128,3 +124,3 @@ } | ||
// Parse decimal digits and allow trailing fractional part | ||
if (kind & (NumberKind.Decimal | NumberKind.DecimalWithLeadingZero)) { | ||
if (kind & NumberKind.DecimalNumberKind) { | ||
if (atStart) { | ||
@@ -146,3 +142,3 @@ while (digit >= 0 && CharTypes[char] & (CharFlags.Decimal | CharFlags.Underscore)) { | ||
if (digit >= 0 && !isIdentifierStart(char) && char !== Chars.Period && char !== Chars.Underscore) { | ||
if (digit >= 0 && !isIdentifierStart(char) && char !== Chars.Period) { | ||
// Most numbers are pure decimal integers without fractional component | ||
@@ -162,6 +158,5 @@ // or exponential notation. Handle that with optimized code. | ||
if (char === Chars.Period) { | ||
char = nextCP(parser); | ||
if (char === Chars.Underscore) report(parser, Errors.Unexpected); | ||
isFloat = 1; | ||
value += '.' + scanDecimalDigitsOrSeparator(parser, char); | ||
if (nextCP(parser) === Chars.Underscore) report(parser, Errors.Unexpected); | ||
kind = NumberKind.Float; | ||
value += '.' + scanDecimalDigitsOrSeparator(parser, parser.nextCP); | ||
char = parser.nextCP; | ||
@@ -175,4 +170,3 @@ } | ||
if (char === Chars.LowerN) { | ||
if (isFloat) report(parser, Errors.InvalidBigInt); | ||
if (char === Chars.LowerN && kind & NumberKind.ValidBigIntKind) { | ||
isBigInt = 1; | ||
@@ -182,10 +176,9 @@ char = nextCP(parser); | ||
// Consume any exponential notation. | ||
if ((parser.nextCP | 32) === Chars.LowerE) { | ||
if ((char | 32) === Chars.LowerE) { | ||
char = nextCP(parser); | ||
// '-', '+' | ||
if (CharTypes[char] & CharFlags.Exponent) { | ||
char = nextCP(parser); | ||
} | ||
if (CharTypes[char] & CharFlags.Exponent) char = nextCP(parser); | ||
const preNumericPart = parser.index; | ||
const { index } = parser; | ||
@@ -196,3 +189,3 @@ // Exponential notation must contain at least one digit | ||
// Consume exponential digits | ||
value += parser.source.substring(end, preNumericPart) + scanDecimalDigitsOrSeparator(parser, char); | ||
value += parser.source.substring(end, index) + scanDecimalDigitsOrSeparator(parser, char); | ||
@@ -219,3 +212,3 @@ char = parser.nextCP; | ||
: kind & NumberKind.DecimalWithLeadingZero | ||
? parseFloat(parser.source.slice(parser.tokenIndex, parser.index)) | ||
? parseFloat(parser.source.substring(parser.tokenIndex, parser.index)) | ||
: +value; | ||
@@ -240,7 +233,7 @@ | ||
if (char === Chars.Underscore) { | ||
const preUnderscoreIndex = parser.index; | ||
const { index } = parser; | ||
char = nextCP(parser); | ||
if (char === Chars.Underscore) report(parser, Errors.ContinuousNumericSeparator); | ||
allowSeparator = 1; | ||
ret += parser.source.substring(start, preUnderscoreIndex); | ||
ret += parser.source.substring(start, index); | ||
start = parser.index; | ||
@@ -247,0 +240,0 @@ continue; |
@@ -71,7 +71,8 @@ import { Chars } from '../chars'; | ||
let mask = RegexFlags.Empty; | ||
let char = parser.nextCP; | ||
const { index: flagStart } = parser; | ||
loop: while (isIdentifierPart(parser.nextCP)) { | ||
switch (parser.nextCP) { | ||
while (isIdentifierPart(char)) { | ||
switch (char) { | ||
case Chars.LowerG: | ||
@@ -111,3 +112,3 @@ if (mask & RegexFlags.Global) report(parser, Errors.DuplicateRegExpFlag, 'g'); | ||
nextCP(parser); | ||
char = nextCP(parser); | ||
} | ||
@@ -114,0 +115,0 @@ |
@@ -1,2 +0,1 @@ | ||
import { skipSingleLineComment, skipMultiLineComment, LexerState } from './'; | ||
import { CharTypes, CharFlags } from './charClassifier'; | ||
@@ -10,2 +9,5 @@ import { Chars } from '../chars'; | ||
nextCP, | ||
skipSingleLineComment, | ||
skipMultiLineComment, | ||
LexerState, | ||
consumeMultiUnitCodePoint, | ||
@@ -16,2 +18,3 @@ isExoticECMAScriptWhitespace, | ||
scanNumber, | ||
NumberKind, | ||
scanString, | ||
@@ -194,6 +197,6 @@ scanIdentifier, | ||
const first = parser.nextCP; | ||
const char = parser.nextCP; | ||
if (first <= 0x7e) { | ||
const token = TokenLookup[first]; | ||
if (char <= 0x7e) { | ||
const token = TokenLookup[char]; | ||
@@ -238,7 +241,7 @@ switch (token) { | ||
case Token.NumericLiteral: | ||
return scanNumber(parser, context, /* isFloat */ 0); | ||
return scanNumber(parser, context, NumberKind.Decimal); | ||
// Look for a string or a template string | ||
case Token.StringLiteral: | ||
return scanString(parser, context); | ||
return scanString(parser, context, char); | ||
@@ -492,3 +495,4 @@ case Token.Template: | ||
nextCP(parser); | ||
if ((CharTypes[parser.nextCP] & CharFlags.Decimal) !== 0) return scanNumber(parser, context, /* isFloat */ 1); | ||
if ((CharTypes[parser.nextCP] & CharFlags.Decimal) !== 0) | ||
return scanNumber(parser, context, NumberKind.Float | NumberKind.Decimal); | ||
if (parser.nextCP === Chars.Period) { | ||
@@ -506,3 +510,3 @@ if (nextCP(parser) === Chars.Period) { | ||
} else { | ||
if ((first ^ Chars.LineSeparator) <= 1) { | ||
if ((char ^ Chars.LineSeparator) <= 1) { | ||
state = (state | LexerState.LastIsCR | LexerState.NewLine) ^ LexerState.LastIsCR; | ||
@@ -513,3 +517,3 @@ scanNewLine(parser); | ||
if (isIDStart(first) || consumeMultiUnitCodePoint(parser, first)) { | ||
if (isIDStart(char) || consumeMultiUnitCodePoint(parser, char)) { | ||
parser.tokenValue = ''; | ||
@@ -519,3 +523,3 @@ return scanIdentifierSlowCase(parser, context, /* hasEscape */ 0, /* canBeKeyword */ 0); | ||
if (isExoticECMAScriptWhitespace(first)) { | ||
if (isExoticECMAScriptWhitespace(char)) { | ||
nextCP(parser); | ||
@@ -526,3 +530,3 @@ continue; | ||
// Invalid ASCII code point/unit | ||
report(parser, Errors.IllegalCaracter, fromCodePoint(first)); | ||
report(parser, Errors.IllegalCaracter, fromCodePoint(char)); | ||
} | ||
@@ -529,0 +533,0 @@ } |
@@ -19,10 +19,11 @@ import { ParserState, Context, Flags } from '../common'; | ||
*/ | ||
export function scanString(parser: ParserState, context: Context): any { | ||
const quote = parser.nextCP; | ||
export function scanString(parser: ParserState, context: Context, quote: number): any { | ||
const { index: start } = parser; | ||
let ret: string | void = ''; | ||
let ch = nextCP(parser); | ||
let char = nextCP(parser); | ||
let marker = parser.index; // Consumes the quote | ||
while ((CharTypes[ch] & CharFlags.LineTerminator) === 0) { | ||
if (ch === quote) { | ||
while ((CharTypes[char] & CharFlags.LineTerminator) === 0) { | ||
if (char === quote) { | ||
ret += parser.source.slice(marker, parser.index); | ||
@@ -35,10 +36,10 @@ nextCP(parser); // skip closing quote | ||
if ((ch & 8) === 8 && ch === Chars.Backslash) { | ||
if ((char & 8) === 8 && char === Chars.Backslash) { | ||
ret += parser.source.slice(marker, parser.index); | ||
const ch = nextCP(parser); | ||
char = nextCP(parser); | ||
if (ch > 0x7e) { | ||
ret += fromCodePoint(ch); | ||
if (char > 0x7e) { | ||
ret += fromCodePoint(char); | ||
} else { | ||
const code = parseEscape(parser, context, ch); | ||
const code = parseEscape(parser, context, char); | ||
@@ -52,3 +53,4 @@ if (code >= 0) ret += fromCodePoint(code); | ||
if (parser.index >= parser.end) report(parser, Errors.UnterminatedString); | ||
ch = nextCP(parser); | ||
char = nextCP(parser); | ||
} | ||
@@ -55,0 +57,0 @@ |
@@ -26,2 +26,2 @@ import { Context } from './common'; | ||
export const version = '1.2.1'; | ||
export const version = '1.2.5'; |
// Unicode v. 12 support | ||
// tslint:disable | ||
/*eslint-disable*/ | ||
@@ -4,0 +4,0 @@ function isIDContinue(code:number) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
2588633
30
72
47577