From d1ba506c8c0d34c54ad51017e6f24969fccb33b4 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Fri, 9 Dec 2022 19:38:50 +0800 Subject: [PATCH] Literal and Escape Sequence --- src/compiler/binder.ts | 11 +- src/compiler/diagnosticMessages.json | 8 + src/compiler/factory/nodeFactory.ts | 4 +- src/compiler/parser.ts | 19 +- src/compiler/scanner.ts | 166 ++-- src/compiler/transformers/taggedTemplate.ts | 3 +- src/compiler/types.ts | 13 +- .../reference/api/tsserverlibrary.d.ts | 1 - tests/baselines/reference/api/typescript.d.ts | 1 - ...eEscapeSequences(target=es2015).errors.txt | 14 +- ...dTemplateEscapeSequences(target=es2015).js | 8 +- ...lateEscapeSequences(target=es5).errors.txt | 14 +- ...ggedTemplateEscapeSequences(target=es5).js | 2 +- ...eEscapeSequences(target=esnext).errors.txt | 14 +- ...CompilationBindStrictModeErrors.errors.txt | 5 +- ...alAndEscapeSequence(target=es3).errors.txt | 451 ++++++++++ ...talLiteralAndEscapeSequence(target=es3).js | 240 ++++++ ...teralAndEscapeSequence(target=es3).symbols | 123 +++ ...LiteralAndEscapeSequence(target=es3).types | 391 +++++++++ ...alAndEscapeSequence(target=es5).errors.txt | 451 ++++++++++ ...talLiteralAndEscapeSequence(target=es5).js | 240 ++++++ ...teralAndEscapeSequence(target=es5).symbols | 123 +++ ...LiteralAndEscapeSequence(target=es5).types | 391 +++++++++ .../octalLiteralInStrictModeES3.errors.txt | 7 +- .../parser.numericSeparators.unicodeEscape.js | 20 +- ...rser.numericSeparators.unicodeEscape.types | 60 +- .../reference/plainJSBinderErrors.errors.txt | 5 +- .../reference/scannerS7.8.4_A7.1_T4.types | 2 +- .../strictModeOctalLiterals.errors.txt | 11 +- .../reference/stringLiteralsErrors.types | 8 +- ...gedTemplateStringsHexadecimalEscapesES6.js | 6 +- ...gedTemplateStringsWithUnicodeEscapesES6.js | 6 +- ...teralEscapeSequence(target=es3).errors.txt | 255 ++++++ ...mplateLiteralEscapeSequence(target=es3).js | 312 +++++++ ...eLiteralEscapeSequence(target=es3).symbols | 374 +++++++++ ...ateLiteralEscapeSequence(target=es3).types | 791 ++++++++++++++++++ ...teralEscapeSequence(target=es5).errors.txt | 255 ++++++ ...mplateLiteralEscapeSequence(target=es5).js | 312 +++++++ ...eLiteralEscapeSequence(target=es5).symbols | 374 +++++++++ ...ateLiteralEscapeSequence(target=es5).types | 791 ++++++++++++++++++ .../getSupportedCodeFixes-can-be-proxied.js | 6 + .../unicodeExtendedEscapesInStrings07_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings07_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings07_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings12_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings12_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings12_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings14_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings14_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings14_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings17_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings17_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings17_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings19_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings19_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings19_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings20_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings20_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings20_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings21_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings21_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings21_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings22_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings22_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings22_ES6.types | 2 +- .../unicodeExtendedEscapesInStrings24_ES5.js | 2 +- ...nicodeExtendedEscapesInStrings24_ES5.types | 2 +- ...nicodeExtendedEscapesInStrings24_ES6.types | 2 +- ...unicodeExtendedEscapesInTemplates07_ES5.js | 2 +- ...codeExtendedEscapesInTemplates07_ES5.types | 2 +- ...codeExtendedEscapesInTemplates07_ES6.types | 2 +- ...unicodeExtendedEscapesInTemplates12_ES5.js | 2 +- ...codeExtendedEscapesInTemplates12_ES5.types | 2 +- ...codeExtendedEscapesInTemplates12_ES6.types | 2 +- ...unicodeExtendedEscapesInTemplates14_ES5.js | 2 +- ...codeExtendedEscapesInTemplates14_ES5.types | 2 +- ...codeExtendedEscapesInTemplates14_ES6.types | 2 +- ...unicodeExtendedEscapesInTemplates17_ES5.js | 2 +- ...codeExtendedEscapesInTemplates17_ES5.types | 2 +- ...codeExtendedEscapesInTemplates17_ES6.types | 2 +- ...unicodeExtendedEscapesInTemplates19_ES5.js | 2 +- ...codeExtendedEscapesInTemplates19_ES5.types | 2 +- ...codeExtendedEscapesInTemplates19_ES6.types | 2 +- .../compiler/octalLiteralAndEscapeSequence.ts | 122 +++ .../compiler/templateLiteralEscapeSequence.ts | 157 ++++ 85 files changed, 6426 insertions(+), 225 deletions(-) create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols create mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types create mode 100644 tests/cases/compiler/octalLiteralAndEscapeSequence.ts create mode 100644 tests/cases/compiler/templateLiteralEscapeSequence.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 64fbdbce0e572..b8e3264b663c8 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2627,8 +2627,15 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { } } + function checkStrictModeStringLiteral(node: StringLiteral) { + if (languageVersion >= ScriptTarget.ES5 && inStrictMode && node.rangesOfOctalSequences) { + file.bindDiagnostics.push(...node.rangesOfOctalSequences.map( + range => createFileDiagnostic(file, range.pos, range.end - range.pos, Diagnostics.Octal_escape_sequences_are_not_allowed_in_strict_mode))); + } + } + function checkStrictModeNumericLiteral(node: NumericLiteral) { - if (languageVersion < ScriptTarget.ES5 && inStrictMode && node.numericLiteralFlags & TokenFlags.Octal) { + if (languageVersion >= ScriptTarget.ES5 && inStrictMode && node.numericLiteralFlags & TokenFlags.Octal) { file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); } } @@ -2875,6 +2882,8 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { return checkStrictModeCatchClause(node as CatchClause); case SyntaxKind.DeleteExpression: return checkStrictModeDeleteExpression(node as DeleteExpression); + case SyntaxKind.StringLiteral: + return checkStrictModeStringLiteral(node as StringLiteral); case SyntaxKind.NumericLiteral: return checkStrictModeNumericLiteral(node as NumericLiteral); case SyntaxKind.PostfixUnaryExpression: diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e146cce88c8cb..5a77caf1dc95b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1549,6 +1549,14 @@ "category": "Message", "code": 1483 }, + "Octal escape sequences are not allowed in strict mode.": { + "category": "Error", + "code": 1484 + }, + "Octal escape sequences are not allowed in template strings.": { + "category": "Error", + "code": 1485 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 4e872d7babb73..686b93d9dbd6a 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -374,6 +374,7 @@ import { QuestionDotToken, QuestionToken, ReadonlyKeyword, + ReadonlyTextRange, reduceLeft, RegularExpressionLiteral, RestTypeNode, @@ -1292,10 +1293,11 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode } // @api - function createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean): StringLiteral { + function createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean, rangesOfOctalSequences?: ReadonlyTextRange[]): StringLiteral { const node = createBaseStringLiteral(text, isSingleQuote); node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; if (hasExtendedUnicodeEscape) node.transformFlags |= TransformFlags.ContainsES2015; + node.rangesOfOctalSequences = rangesOfOctalSequences; return node; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f1f8bd002e875..7a0e372bb1f70 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2153,10 +2153,6 @@ namespace Parser { return currentToken = scanner.reScanTemplateToken(isTaggedTemplate); } - function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind { - return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate(); - } - function reScanLessThanToken(): SyntaxKind { return currentToken = scanner.reScanLessThanToken(); } @@ -3606,9 +3602,7 @@ namespace Parser { } function parseTemplateHead(isTaggedTemplate: boolean): TemplateHead { - if (isTaggedTemplate) { - reScanTemplateHeadOrNoSubstitutionTemplate(); - } + reScanTemplateToken(isTaggedTemplate); const fragment = parseLiteralLikeNode(token()); Debug.assert(fragment.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind"); return fragment as TemplateHead; @@ -3630,14 +3624,13 @@ namespace Parser { const pos = getNodePos(); const node = isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, scanner.getTokenValue(), getTemplateLiteralRawText(kind), scanner.getTokenFlags() & TokenFlags.TemplateLiteralLikeFlags) : - // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal. But because of how the scanner separates the tokens, we would // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. kind === SyntaxKind.NumericLiteral ? factory.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : - kind === SyntaxKind.StringLiteral ? factory.createStringLiteral(scanner.getTokenValue(), /*isSingleQuote*/ undefined, scanner.hasExtendedUnicodeEscape()) : + kind === SyntaxKind.StringLiteral ? factory.createStringLiteral(scanner.getTokenValue(), /*isSingleQuote*/ undefined, scanner.hasExtendedUnicodeEscape(), scanner.getRangesOfOctalSequences()) : isLiteralKind(kind) ? factory.createLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail(); @@ -6314,7 +6307,7 @@ namespace Parser { tag, typeArguments, token() === SyntaxKind.NoSubstitutionTemplateLiteral ? - (reScanTemplateHeadOrNoSubstitutionTemplate(), parseLiteralNode() as NoSubstitutionTemplateLiteral) : + (reScanTemplateToken(/*isTaggedTemplate*/ true), parseLiteralNode() as NoSubstitutionTemplateLiteral) : parseTemplateExpression(/*isTaggedTemplate*/ true) ); if (questionDotToken || tag.flags & NodeFlags.OptionalChain) { @@ -6414,10 +6407,14 @@ namespace Parser { function parsePrimaryExpression(): PrimaryExpression { switch (token()) { + case SyntaxKind.NoSubstitutionTemplateLiteral: + if (scanner.getTokenFlags() & TokenFlags.ContainsOctalOrInvalidEscape) { + reScanTemplateToken(/* isTaggedTemplate */ false); + } + // falls through case SyntaxKind.NumericLiteral: case SyntaxKind.BigIntLiteral: case SyntaxKind.StringLiteral: - case SyntaxKind.NoSubstitutionTemplateLiteral: return parseLiteralNode(); case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index bdb2fe6ef239e..d6f87bc194883 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -21,6 +21,7 @@ import { MapLike, parsePseudoBigInt, positionIsSynthesized, + ReadonlyTextRange, ScriptTarget, SourceFileLike, SyntaxKind, @@ -61,11 +62,12 @@ export interface Scanner { getCommentDirectives(): CommentDirective[] | undefined; /** @internal */ getTokenFlags(): TokenFlags; + /** @internal */ + getRangesOfOctalSequences(): ReadonlyTextRange[]; reScanGreaterToken(): SyntaxKind; reScanSlashToken(): SyntaxKind; reScanAsteriskEqualsToken(): SyntaxKind; reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; - reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; scanJsxIdentifier(): SyntaxKind; scanJsxAttributeValue(): SyntaxKind; reScanJsxAttributeValue(): SyntaxKind; @@ -984,6 +986,7 @@ export function createScanner(languageVersion: ScriptTarget, let token: SyntaxKind; let tokenValue!: string; let tokenFlags: TokenFlags; + let rangesOfOctalSequences: ReadonlyTextRange[]; let commentDirectives: CommentDirective[] | undefined; let inJSDocType = 0; @@ -1007,11 +1010,11 @@ export function createScanner(languageVersion: ScriptTarget, getCommentDirectives: () => commentDirectives, getNumericLiteralFlags: () => tokenFlags & TokenFlags.NumericLiteralFlags, getTokenFlags: () => tokenFlags, + getRangesOfOctalSequences: () => rangesOfOctalSequences, reScanGreaterToken, reScanAsteriskEqualsToken, reScanSlashToken, reScanTemplateToken, - reScanTemplateHeadOrNoSubstitutionTemplate, scanJsxIdentifier, scanJsxAttributeValue, reScanJsxAttributeValue, @@ -1244,6 +1247,7 @@ export function createScanner(languageVersion: ScriptTarget, pos++; let result = ""; let start = pos; + rangesOfOctalSequences = []; while (true) { if (pos >= end) { result += text.substring(start, pos); @@ -1259,7 +1263,7 @@ export function createScanner(languageVersion: ScriptTarget, } if (ch === CharacterCodes.backslash && !jsxAttributeString) { result += text.substring(start, pos); - result += scanEscapeSequence(); + result += scanEscapeSequence(/*shouldEmitInvalidEscapeError*/ true); start = pos; continue; } @@ -1278,13 +1282,14 @@ export function createScanner(languageVersion: ScriptTarget, * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or * a literal component of a TemplateExpression. */ - function scanTemplateAndSetTokenValue(isTaggedTemplate: boolean): SyntaxKind { + function scanTemplateAndSetTokenValue(shouldEmitInvalidEscapeError: boolean): SyntaxKind { const startedWithBacktick = text.charCodeAt(pos) === CharacterCodes.backtick; pos++; let start = pos; let contents = ""; let resultingToken: SyntaxKind; + rangesOfOctalSequences = []; while (true) { if (pos >= end) { @@ -1316,7 +1321,7 @@ export function createScanner(languageVersion: ScriptTarget, // Escape character if (currChar === CharacterCodes.backslash) { contents += text.substring(start, pos); - contents += scanEscapeSequence(isTaggedTemplate); + contents += scanEscapeSequence(shouldEmitInvalidEscapeError); start = pos; continue; } @@ -1340,12 +1345,17 @@ export function createScanner(languageVersion: ScriptTarget, } Debug.assert(resultingToken !== undefined); + if (shouldEmitInvalidEscapeError) { + rangesOfOctalSequences.forEach(range => { + error(Diagnostics.Octal_escape_sequences_are_not_allowed_in_template_strings, range.pos, range.end - range.pos); + }); + } tokenValue = contents; return resultingToken; } - function scanEscapeSequence(isTaggedTemplate?: boolean): string { + function scanEscapeSequence(shouldEmitInvalidEscapeError?: boolean): string { const start = pos; pos++; if (pos >= end) { @@ -1356,13 +1366,37 @@ export function createScanner(languageVersion: ScriptTarget, pos++; switch (ch) { case CharacterCodes._0: - // '\01' - if (isTaggedTemplate && pos < end && isDigit(text.charCodeAt(pos))) { + // '\08' is '\0' + '8' but is treated as an octal escape sequence, thus isDigit + if (!(pos < end && isDigit(text.charCodeAt(pos)))) { + return "\0"; + } + // '\01', '\011' + // falls through + case CharacterCodes._1: + case CharacterCodes._2: + case CharacterCodes._3: + // '\1', '\17', '\177' + if (pos < end && isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + // '\17', '\177' + // falls through + case CharacterCodes._4: + case CharacterCodes._5: + case CharacterCodes._6: + case CharacterCodes._7: + // '\4', '\47' but not '\477' + if (pos < end && isOctalDigit(text.charCodeAt(pos))) { pos++; - tokenFlags |= TokenFlags.ContainsInvalidEscape; - return text.substring(start, pos); } - return "\0"; + // '\47' + // falls through + case CharacterCodes._8: + case CharacterCodes._9: + // the invalid '\8' and '\9' + tokenFlags |= TokenFlags.OctalEscape; + rangesOfOctalSequences.push({ pos: start, end: pos }); + return String.fromCharCode(parseInt(text.substring(start + 1, pos), 8)); case CharacterCodes.b: return "\b"; case CharacterCodes.t: @@ -1380,62 +1414,70 @@ export function createScanner(languageVersion: ScriptTarget, case CharacterCodes.doubleQuote: return "\""; case CharacterCodes.u: - if (isTaggedTemplate) { - // '\u' or '\u0' or '\u00' or '\u000' - for (let escapePos = pos; escapePos < pos + 4; escapePos++) { - if (escapePos < end && !isHexDigit(text.charCodeAt(escapePos)) && text.charCodeAt(escapePos) !== CharacterCodes.openBrace) { - pos = escapePos; - tokenFlags |= TokenFlags.ContainsInvalidEscape; - return text.substring(start, pos); - } - } - } - // '\u{DDDDDDDD}' if (pos < end && text.charCodeAt(pos) === CharacterCodes.openBrace) { + // '\u{DDDDDDDD}' pos++; - - // '\u{' - if (isTaggedTemplate && !isHexDigit(text.charCodeAt(pos))) { + const escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); + const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + // '\u{Not Code Point' or '\u{CodePoint' + if (escapedValue < 0) { tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.Hexadecimal_digit_expected); + } return text.substring(start, pos); } - - if (isTaggedTemplate) { - const savePos = pos; - const escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); - const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; - - // '\u{Not Code Point' or '\u{CodePoint' - if (!isCodePoint(escapedValue) || text.charCodeAt(pos) !== CharacterCodes.closeBrace) { - tokenFlags |= TokenFlags.ContainsInvalidEscape; - return text.substring(start, pos); + if (!isCodePoint(escapedValue)) { + tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); } - else { - pos = savePos; + return text.substring(start, pos); + } + if (pos >= end) { + tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.Unexpected_end_of_text); } + return text.substring(start, pos); + } + if (text.charCodeAt(pos) !== CharacterCodes.closeBrace) { + tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.Unterminated_Unicode_escape_sequence); + } + return text.substring(start, pos); } + pos++; tokenFlags |= TokenFlags.ExtendedUnicodeEscape; - return scanExtendedUnicodeEscape(); + return utf16EncodeAsString(escapedValue); } - - tokenFlags |= TokenFlags.UnicodeEscape; // '\uDDDD' - return scanHexadecimalEscape(/*numDigits*/ 4); - - case CharacterCodes.x: - if (isTaggedTemplate) { - if (!isHexDigit(text.charCodeAt(pos))) { + for (; pos < start + 6; pos++) { + if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.Hexadecimal_digit_expected); + } return text.substring(start, pos); } - else if (!isHexDigit(text.charCodeAt(pos + 1))) { - pos++; + } + tokenFlags |= TokenFlags.UnicodeEscape; + return String.fromCharCode(parseInt(text.substring(start + 2, pos), 16)); + + case CharacterCodes.x: + // '\xDD' + for (; pos < start + 4; pos++) { + if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics.Hexadecimal_digit_expected); + } return text.substring(start, pos); } } - // '\xDD' - return scanHexadecimalEscape(/*numDigits*/ 2); + tokenFlags |= TokenFlags.HexEscape; + return String.fromCharCode(parseInt(text.substring(start + 2, pos), 16)); // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), // the line terminator is interpreted to be "the empty code unit sequence". @@ -1453,18 +1495,6 @@ export function createScanner(languageVersion: ScriptTarget, } } - function scanHexadecimalEscape(numDigits: number): string { - const escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false); - - if (escapedValue >= 0) { - return String.fromCharCode(escapedValue); - } - else { - error(Diagnostics.Hexadecimal_digit_expected); - return ""; - } - } - function scanExtendedUnicodeEscape(): string { const escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; @@ -1724,7 +1754,7 @@ export function createScanner(languageVersion: ScriptTarget, tokenValue = scanString(); return token = SyntaxKind.StringLiteral; case CharacterCodes.backtick: - return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ false); + return token = scanTemplateAndSetTokenValue(/*shouldEmitInvalidEscapeError*/ false); case CharacterCodes.percent: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.PercentEqualsToken; @@ -2288,14 +2318,8 @@ export function createScanner(languageVersion: ScriptTarget, * Unconditionally back up and scan a template expression portion. */ function reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind { - Debug.assert(token === SyntaxKind.CloseBraceToken, "'reScanTemplateToken' should only be called on a '}'"); - pos = tokenPos; - return token = scanTemplateAndSetTokenValue(isTaggedTemplate); - } - - function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind { pos = tokenPos; - return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ true); + return token = scanTemplateAndSetTokenValue(!isTaggedTemplate); } function reScanJsxToken(allowMultilineJsxText = true): JsxTokenSyntaxKind { @@ -2550,6 +2574,7 @@ export function createScanner(languageVersion: ScriptTarget, const saveToken = token; const saveTokenValue = tokenValue; const saveTokenFlags = tokenFlags; + const saveRangesOfOctalSequences = rangesOfOctalSequences; const result = callback(); // If our callback returned something 'falsy' or we're just looking ahead, @@ -2561,6 +2586,7 @@ export function createScanner(languageVersion: ScriptTarget, token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + rangesOfOctalSequences = saveRangesOfOctalSequences; } return result; } @@ -2573,6 +2599,7 @@ export function createScanner(languageVersion: ScriptTarget, const saveToken = token; const saveTokenValue = tokenValue; const saveTokenFlags = tokenFlags; + const saveRangesOfOctalSequences = rangesOfOctalSequences; const saveErrorExpectations = commentDirectives; setText(text, start, length); @@ -2585,6 +2612,7 @@ export function createScanner(languageVersion: ScriptTarget, token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; + rangesOfOctalSequences = saveRangesOfOctalSequences; commentDirectives = saveErrorExpectations; return result; diff --git a/src/compiler/transformers/taggedTemplate.ts b/src/compiler/transformers/taggedTemplate.ts index 041e0adf84acb..4140bf3dd6af9 100644 --- a/src/compiler/transformers/taggedTemplate.ts +++ b/src/compiler/transformers/taggedTemplate.ts @@ -18,6 +18,7 @@ import { TemplateLiteralLikeNode, TemplateMiddle, TemplateTail, + TokenFlags, TransformationContext, visitEachChild, visitNode, @@ -93,7 +94,7 @@ export function processTaggedTemplateExpression( } function createTemplateCooked(template: TemplateHead | TemplateMiddle | TemplateTail | NoSubstitutionTemplateLiteral) { - return template.templateFlags ? factory.createVoidZero() : factory.createStringLiteral(template.text); + return template.templateFlags! & TokenFlags.ContainsOctalOrInvalidEscape ? factory.createVoidZero() : factory.createStringLiteral(template.text); } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f8b0f5ef6dee2..8f719736ec9ad 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2105,6 +2105,7 @@ export interface StringLiteral extends LiteralExpression, Declaration { * @internal */ readonly singleQuote?: boolean; + /** @internal */ readonly rangesOfOctalSequences?: ReadonlyTextRange[]; } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; @@ -2567,11 +2568,19 @@ export const enum TokenFlags { /** @internal */ ContainsInvalidEscape = 1 << 11, // e.g. `\uhello` /** @internal */ + OctalEscape = 1 << 12, // e.g. `\1` + /** @internal */ + HexEscape = 1 << 13, // e.g. `\xa0` + /** @internal */ BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, /** @internal */ + StringLiteralFlags = OctalEscape | HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, + /** @internal */ NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator, /** @internal */ - TemplateLiteralLikeFlags = ContainsInvalidEscape, + TemplateLiteralLikeFlags = OctalEscape | HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, + /** @internal */ + ContainsOctalOrInvalidEscape = OctalEscape | ContainsInvalidEscape, } export interface NumericLiteral extends LiteralExpression, Declaration { @@ -7801,7 +7810,7 @@ export interface NodeFactory { createNumericLiteral(value: string | number, numericLiteralFlags?: TokenFlags): NumericLiteral; createBigIntLiteral(value: string | PseudoBigInt): BigIntLiteral; createStringLiteral(text: string, isSingleQuote?: boolean): StringLiteral; - /** @internal */ createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean): StringLiteral; // eslint-disable-line @typescript-eslint/unified-signatures + /** @internal */ createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean, rangesOfOctalSequences?: ReadonlyTextRange[]): StringLiteral; // eslint-disable-line @typescript-eslint/unified-signatures createStringLiteralFromNode(sourceNode: PropertyNameLiteral | PrivateIdentifier, isSingleQuote?: boolean): StringLiteral; createRegularExpressionLiteral(text: string): RegularExpressionLiteral; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f2133809e1a8f..0c387120867bf 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8468,7 +8468,6 @@ declare namespace ts { reScanSlashToken(): SyntaxKind; reScanAsteriskEqualsToken(): SyntaxKind; reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; - reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; scanJsxIdentifier(): SyntaxKind; scanJsxAttributeValue(): SyntaxKind; reScanJsxAttributeValue(): SyntaxKind; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 5504da395bb1d..816e128b37707 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4534,7 +4534,6 @@ declare namespace ts { reScanSlashToken(): SyntaxKind; reScanAsteriskEqualsToken(): SyntaxKind; reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; - reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; scanJsxIdentifier(): SyntaxKind; scanJsxAttributeValue(): SyntaxKind; reScanJsxAttributeValue(): SyntaxKind; diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).errors.txt b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).errors.txt index c8846ae349714..e03787d7799d5 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).errors.txt +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).errors.txt @@ -1,13 +1,9 @@ -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(7,18): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,15): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,33): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,75): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,18): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,27): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): error TS1125: Hexadecimal digit expected. -==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (7 errors) ==== +==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (3 errors) ==== function tag (str: any, ...args: any[]): any { return str } @@ -15,8 +11,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er const a = tag`123` const b = tag`123 ${100}` const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; - -!!! error TS1125: Hexadecimal digit expected. const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate !!! error TS1125: Hexadecimal digit expected. @@ -25,12 +19,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er !!! error TS1125: Hexadecimal digit expected. const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. const a1 = tag`${ 100 }\0` // \0 const a2 = tag`${ 100 }\00` // \\00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js index bed4ca912d8b8..79636aedae7d7 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js @@ -44,11 +44,11 @@ const a3 = tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 100); // \\u const a4 = tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 100); // \\u0 const a5 = tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 100); // \\u00 const a6 = tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 100); // \\u000 -const a7 = tag `${100}\u0000`; // \u0000 +const a7 = tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 100); // \u0000 const a8 = tag(__makeTemplateObject(["", void 0], ["", "\\u{"]), 100); // \\u{ -const a9 = tag `${100}\u{10FFFF}`; // \\u{10FFFF +const a9 = tag(__makeTemplateObject(["", "\uDBFF\uDFFF"], ["", "\\u{10FFFF}"]), 100); // \\u{10FFFF const a10 = tag(__makeTemplateObject(["", void 0], ["", "\\u{1f622"]), 100); // \\u{1f622 -const a11 = tag `${100}\u{1f622}`; // \u{1f622} +const a11 = tag(__makeTemplateObject(["", "\uD83D\uDE22"], ["", "\\u{1f622}"]), 100); // \u{1f622} const a12 = tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 100); // \\x const a13 = tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 100); // \\x0 -const a14 = tag `${100}\x00`; // \x00 +const a14 = tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 100); // \x00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).errors.txt b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).errors.txt index c8846ae349714..e03787d7799d5 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).errors.txt +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).errors.txt @@ -1,13 +1,9 @@ -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(7,18): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,15): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,33): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,75): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,18): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,27): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): error TS1125: Hexadecimal digit expected. -==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (7 errors) ==== +==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (3 errors) ==== function tag (str: any, ...args: any[]): any { return str } @@ -15,8 +11,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er const a = tag`123` const b = tag`123 ${100}` const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; - -!!! error TS1125: Hexadecimal digit expected. const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate !!! error TS1125: Hexadecimal digit expected. @@ -25,12 +19,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er !!! error TS1125: Hexadecimal digit expected. const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. const a1 = tag`${ 100 }\0` // \0 const a2 = tag`${ 100 }\00` // \\00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js index b980ba0304d20..c9854c5feca38 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js @@ -40,7 +40,7 @@ function tag(str) { var a = tag(__makeTemplateObject(["123"], ["123"])); var b = tag(__makeTemplateObject(["123 ", ""], ["123 ", ""]), 100); var x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); -var y = "hello} ".concat(100, " traordinary ").concat(200, " wonderful ").concat(300, " world"); // should error with NoSubstitutionTemplate +var y = "\\u{hello} ".concat(100, " \\xtraordinary ").concat(200, " wonderful ").concat(300, " \\uworld"); // should error with NoSubstitutionTemplate var z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate var a1 = tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 100); // \0 var a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).errors.txt b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).errors.txt index c8846ae349714..e03787d7799d5 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).errors.txt +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).errors.txt @@ -1,13 +1,9 @@ -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(7,18): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,15): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,33): error TS1125: Hexadecimal digit expected. tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(8,75): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,18): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,27): error TS1125: Hexadecimal digit expected. -tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): error TS1125: Hexadecimal digit expected. -==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (7 errors) ==== +==== tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts (3 errors) ==== function tag (str: any, ...args: any[]): any { return str } @@ -15,8 +11,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er const a = tag`123` const b = tag`123 ${100}` const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; - -!!! error TS1125: Hexadecimal digit expected. const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate !!! error TS1125: Hexadecimal digit expected. @@ -25,12 +19,6 @@ tests/cases/conformance/es2018/invalidTaggedTemplateEscapeSequences.ts(9,51): er !!! error TS1125: Hexadecimal digit expected. const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. - -!!! error TS1125: Hexadecimal digit expected. const a1 = tag`${ 100 }\0` // \0 const a2 = tag`${ 100 }\00` // \\00 diff --git a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt index 6d1f32442a5ac..64fc50e8307c7 100644 --- a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt +++ b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt @@ -10,6 +10,7 @@ tests/cases/compiler/b.js(3,7): error TS1210: Code contained in a class is evalu tests/cases/compiler/b.js(6,13): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/c.js(1,12): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. tests/cases/compiler/c.js(2,5): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode. +tests/cases/compiler/d.js(2,9): error TS1121: Octal literals are not allowed in strict mode. tests/cases/compiler/d.js(2,11): error TS1005: ',' expected. @@ -71,8 +72,10 @@ tests/cases/compiler/d.js(2,11): error TS1005: ',' expected. !!! error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode. }; -==== tests/cases/compiler/d.js (1 errors) ==== +==== tests/cases/compiler/d.js (2 errors) ==== "use strict"; var x = 009; // error + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. ~ !!! error TS1005: ',' expected. \ No newline at end of file diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt new file mode 100644 index 0000000000000..14de1c76f690e --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt @@ -0,0 +1,451 @@ +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(3,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(4,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(5,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(6,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(7,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(8,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(9,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(10,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(11,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(12,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(13,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(14,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(15,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(16,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(17,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(20,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(21,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(22,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(23,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(24,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(25,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(26,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(28,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(29,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(30,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(31,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(32,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(33,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(34,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(36,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(37,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(38,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(39,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(40,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(41,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(42,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(43,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(44,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(45,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(46,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(47,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(48,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(49,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(50,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(51,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(52,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(53,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(54,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(55,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(56,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(57,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(58,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(59,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(60,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(61,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(62,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(63,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(64,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(65,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(66,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(67,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(68,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(69,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(70,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(71,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(72,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(73,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(74,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(75,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(76,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(77,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(78,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(79,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(80,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(81,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(82,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(83,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(84,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(85,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(86,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(87,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(90,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(91,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(92,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(93,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(94,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(95,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(96,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(98,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(99,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(100,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(101,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(102,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(103,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(104,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(106,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(107,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(108,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(109,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(110,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(111,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(112,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(114,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(115,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(116,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(117,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(119,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(120,6): error TS1485: Octal escape sequences are not allowed in template strings. + + +==== tests/cases/compiler/octalLiteralAndEscapeSequence.ts (109 errors) ==== + "use strict"; + + 00; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 05; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 000; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 005; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 055; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${00}`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${05}`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${000}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${005}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${055}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${00}0`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${05}0`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${000}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${005}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${055}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + + "\0"; + "\5"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\00"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\05"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\55"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\000"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\005"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\055"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0'; + '\5'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\00'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\05'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\55'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\000'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\005'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\055'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + + "\1"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\01"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\001"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\17"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\177"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\18"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\018"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0018"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\4"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\47"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\477"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\48"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\048"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0048"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\8"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\87"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\087"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0087"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\877"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\88"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\088"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0088"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\1'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\01'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\001'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\17'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\177'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\18'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\018'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0018'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\4'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\47'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\477'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\48'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\048'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0048'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\8'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\87'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\087'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0087'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\877'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\88'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\088'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0088'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + + `\0`; + `\5`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\00`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\05`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\55`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\000`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\005`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\055`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\0`; + `${0}\5`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\00`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\05`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\55`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\000`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\005`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\055`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\0${0}`; + `\5${0}`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\00${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\05${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\55${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\000${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\005${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\055${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\0${0}`; + `${0}\5${0}`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\00${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\05${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\55${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\000${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\005${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\055${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + \ No newline at end of file diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js new file mode 100644 index 0000000000000..b00260f6ee8fb --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js @@ -0,0 +1,240 @@ +//// [octalLiteralAndEscapeSequence.ts] +"use strict"; + +00; +05; +000; +005; +055; +`0${00}`; +`0${05}`; +`0${000}`; +`0${005}`; +`0${055}`; +`${00}0`; +`${05}0`; +`${000}0`; +`${005}0`; +`${055}0`; + +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; + +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; + +`\0`; +`\5`; +`\00`; +`\05`; +`\55`; +`\000`; +`\005`; +`\055`; +`${0}\0`; +`${0}\5`; +`${0}\00`; +`${0}\05`; +`${0}\55`; +`${0}\000`; +`${0}\005`; +`${0}\055`; +`\0${0}`; +`\5${0}`; +`\00${0}`; +`\05${0}`; +`\55${0}`; +`\000${0}`; +`\005${0}`; +`\055${0}`; +`${0}\0${0}`; +`${0}\5${0}`; +`${0}\00${0}`; +`${0}\05${0}`; +`${0}\55${0}`; +`${0}\000${0}`; +`${0}\005${0}`; +`${0}\055${0}`; + + +//// [octalLiteralAndEscapeSequence.js] +"use strict"; +00; +05; +000; +005; +055; +"0".concat(00); +"0".concat(05); +"0".concat(000); +"0".concat(005); +"0".concat(055); +"".concat(00, "0"); +"".concat(05, "0"); +"".concat(000, "0"); +"".concat(005, "0"); +"".concat(055, "0"); +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; +"\0"; +"\u0005"; +"\0"; +"\u0005"; +"-"; +"\0"; +"\u0005"; +"-"; +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "-"); +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "-"); +"\0".concat(0); +"\u0005".concat(0); +"\0".concat(0); +"\u0005".concat(0); +"-".concat(0); +"\0".concat(0); +"\u0005".concat(0); +"-".concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "-").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "-").concat(0); diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols new file mode 100644 index 0000000000000..0ba13e38f29d7 --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts === + +"use strict"; + +00; +05; +000; +005; +055; +`0${00}`; +`0${05}`; +`0${000}`; +`0${005}`; +`0${055}`; +`${00}0`; +`${05}0`; +`${000}0`; +`${005}0`; +`${055}0`; + +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; + +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; + +`\0`; +`\5`; +`\00`; +`\05`; +`\55`; +`\000`; +`\005`; +`\055`; +`${0}\0`; +`${0}\5`; +`${0}\00`; +`${0}\05`; +`${0}\55`; +`${0}\000`; +`${0}\005`; +`${0}\055`; +`\0${0}`; +`\5${0}`; +`\00${0}`; +`\05${0}`; +`\55${0}`; +`\000${0}`; +`\005${0}`; +`\055${0}`; +`${0}\0${0}`; +`${0}\5${0}`; +`${0}\00${0}`; +`${0}\05${0}`; +`${0}\55${0}`; +`${0}\000${0}`; +`${0}\005${0}`; +`${0}\055${0}`; + diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types new file mode 100644 index 0000000000000..c006384485d87 --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types @@ -0,0 +1,391 @@ +=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts === +"use strict"; +>"use strict" : "use strict" + +00; +>00 : 0 + +05; +>05 : 5 + +000; +>000 : 0 + +005; +>005 : 5 + +055; +>055 : 55 + +`0${00}`; +>`0${00}` : string +>00 : 0 + +`0${05}`; +>`0${05}` : string +>05 : 5 + +`0${000}`; +>`0${000}` : string +>000 : 0 + +`0${005}`; +>`0${005}` : string +>005 : 5 + +`0${055}`; +>`0${055}` : string +>055 : 55 + +`${00}0`; +>`${00}0` : string +>00 : 0 + +`${05}0`; +>`${05}0` : string +>05 : 5 + +`${000}0`; +>`${000}0` : string +>000 : 0 + +`${005}0`; +>`${005}0` : string +>005 : 5 + +`${055}0`; +>`${055}0` : string +>055 : 55 + +"\0"; +>"\0" : "\0" + +"\5"; +>"\5" : "\u0005" + +"\00"; +>"\00" : "\0" + +"\05"; +>"\05" : "\u0005" + +"\55"; +>"\55" : "-" + +"\000"; +>"\000" : "\0" + +"\005"; +>"\005" : "\u0005" + +"\055"; +>"\055" : "-" + +'\0'; +>'\0' : "\0" + +'\5'; +>'\5' : "\u0005" + +'\00'; +>'\00' : "\0" + +'\05'; +>'\05' : "\u0005" + +'\55'; +>'\55' : "-" + +'\000'; +>'\000' : "\0" + +'\005'; +>'\005' : "\u0005" + +'\055'; +>'\055' : "-" + +"\1"; +>"\1" : "\u0001" + +"\01"; +>"\01" : "\u0001" + +"\001"; +>"\001" : "\u0001" + +"\17"; +>"\17" : "\u000F" + +"\017"; +>"\017" : "\u000F" + +"\0017"; +>"\0017" : "\u00017" + +"\177"; +>"\177" : "" + +"\18"; +>"\18" : "\u00018" + +"\018"; +>"\018" : "\u00018" + +"\0018"; +>"\0018" : "\u00018" + +"\4"; +>"\4" : "\u0004" + +"\47"; +>"\47" : "'" + +"\047"; +>"\047" : "'" + +"\0047"; +>"\0047" : "\u00047" + +"\477"; +>"\477" : "'7" + +"\48"; +>"\48" : "\u00048" + +"\048"; +>"\048" : "\u00048" + +"\0048"; +>"\0048" : "\u00048" + +"\8"; +>"\8" : "\0" + +"\87"; +>"\87" : "\x007" + +"\087"; +>"\087" : "\x0087" + +"\0087"; +>"\0087" : "\x0087" + +"\877"; +>"\877" : "\x0077" + +"\88"; +>"\88" : "\x008" + +"\088"; +>"\088" : "\x0088" + +"\0088"; +>"\0088" : "\x0088" + +'\1'; +>'\1' : "\u0001" + +'\01'; +>'\01' : "\u0001" + +'\001'; +>'\001' : "\u0001" + +'\17'; +>'\17' : "\u000F" + +'\017'; +>'\017' : "\u000F" + +'\0017'; +>'\0017' : "\u00017" + +'\177'; +>'\177' : "" + +'\18'; +>'\18' : "\u00018" + +'\018'; +>'\018' : "\u00018" + +'\0018'; +>'\0018' : "\u00018" + +'\4'; +>'\4' : "\u0004" + +'\47'; +>'\47' : "'" + +'\047'; +>'\047' : "'" + +'\0047'; +>'\0047' : "\u00047" + +'\477'; +>'\477' : "'7" + +'\48'; +>'\48' : "\u00048" + +'\048'; +>'\048' : "\u00048" + +'\0048'; +>'\0048' : "\u00048" + +'\8'; +>'\8' : "\0" + +'\87'; +>'\87' : "\x007" + +'\087'; +>'\087' : "\x0087" + +'\0087'; +>'\0087' : "\x0087" + +'\877'; +>'\877' : "\x0077" + +'\88'; +>'\88' : "\x008" + +'\088'; +>'\088' : "\x0088" + +'\0088'; +>'\0088' : "\x0088" + +`\0`; +>`\0` : "\0" + +`\5`; +>`\5` : "\u0005" + +`\00`; +>`\00` : "\0" + +`\05`; +>`\05` : "\u0005" + +`\55`; +>`\55` : "-" + +`\000`; +>`\000` : "\0" + +`\005`; +>`\005` : "\u0005" + +`\055`; +>`\055` : "-" + +`${0}\0`; +>`${0}\0` : string +>0 : 0 + +`${0}\5`; +>`${0}\5` : string +>0 : 0 + +`${0}\00`; +>`${0}\00` : string +>0 : 0 + +`${0}\05`; +>`${0}\05` : string +>0 : 0 + +`${0}\55`; +>`${0}\55` : string +>0 : 0 + +`${0}\000`; +>`${0}\000` : string +>0 : 0 + +`${0}\005`; +>`${0}\005` : string +>0 : 0 + +`${0}\055`; +>`${0}\055` : string +>0 : 0 + +`\0${0}`; +>`\0${0}` : string +>0 : 0 + +`\5${0}`; +>`\5${0}` : string +>0 : 0 + +`\00${0}`; +>`\00${0}` : string +>0 : 0 + +`\05${0}`; +>`\05${0}` : string +>0 : 0 + +`\55${0}`; +>`\55${0}` : string +>0 : 0 + +`\000${0}`; +>`\000${0}` : string +>0 : 0 + +`\005${0}`; +>`\005${0}` : string +>0 : 0 + +`\055${0}`; +>`\055${0}` : string +>0 : 0 + +`${0}\0${0}`; +>`${0}\0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\5${0}`; +>`${0}\5${0}` : string +>0 : 0 +>0 : 0 + +`${0}\00${0}`; +>`${0}\00${0}` : string +>0 : 0 +>0 : 0 + +`${0}\05${0}`; +>`${0}\05${0}` : string +>0 : 0 +>0 : 0 + +`${0}\55${0}`; +>`${0}\55${0}` : string +>0 : 0 +>0 : 0 + +`${0}\000${0}`; +>`${0}\000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\005${0}`; +>`${0}\005${0}` : string +>0 : 0 +>0 : 0 + +`${0}\055${0}`; +>`${0}\055${0}` : string +>0 : 0 +>0 : 0 + diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt new file mode 100644 index 0000000000000..14de1c76f690e --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt @@ -0,0 +1,451 @@ +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(3,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(4,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(5,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(6,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(7,1): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(8,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(9,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(10,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(11,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(12,5): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(13,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(14,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(15,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(16,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(17,4): error TS1121: Octal literals are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(20,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(21,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(22,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(23,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(24,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(25,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(26,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(28,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(29,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(30,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(31,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(32,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(33,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(34,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(36,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(37,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(38,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(39,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(40,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(41,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(42,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(43,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(44,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(45,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(46,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(47,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(48,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(49,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(50,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(51,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(52,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(53,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(54,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(55,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(56,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(57,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(58,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(59,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(60,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(61,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(62,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(63,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(64,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(65,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(66,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(67,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(68,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(69,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(70,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(71,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(72,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(73,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(74,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(75,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(76,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(77,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(78,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(79,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(80,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(81,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(82,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(83,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(84,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(85,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(86,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(87,2): error TS1484: Octal escape sequences are not allowed in strict mode. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(90,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(91,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(92,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(93,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(94,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(95,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(96,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(98,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(99,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(100,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(101,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(102,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(103,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(104,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(106,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(107,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(108,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(109,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(110,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(111,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(112,2): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(114,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(115,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(116,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(117,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(119,6): error TS1485: Octal escape sequences are not allowed in template strings. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(120,6): error TS1485: Octal escape sequences are not allowed in template strings. + + +==== tests/cases/compiler/octalLiteralAndEscapeSequence.ts (109 errors) ==== + "use strict"; + + 00; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 05; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 000; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 005; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + 055; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${00}`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${05}`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${000}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${005}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `0${055}`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${00}0`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${05}0`; + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${000}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${005}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + `${055}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. + + "\0"; + "\5"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\00"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\05"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\55"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\000"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\005"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\055"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0'; + '\5'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\00'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\05'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\55'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\000'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\005'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\055'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + + "\1"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\01"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\001"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\17"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\177"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\18"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\018"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0018"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\4"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\47"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\477"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\48"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\048"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0048"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\8"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\87"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\087"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0087"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\877"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\88"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\088"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + "\0088"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\1'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\01'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\001'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\17'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\177'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\18'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\018'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0018'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\4'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\47'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\477'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\48'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\048'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0048'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\8'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\87'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\087'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0087'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\877'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\88'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\088'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + '\0088'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed in strict mode. + + `\0`; + `\5`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\00`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\05`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\55`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\000`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\005`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\055`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\0`; + `${0}\5`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\00`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\05`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\55`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\000`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\005`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\055`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\0${0}`; + `\5${0}`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\00${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\05${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\55${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\000${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\005${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `\055${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\0${0}`; + `${0}\5${0}`; + ~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\00${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\05${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\55${0}`; + ~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\000${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\005${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + `${0}\055${0}`; + ~~~~ +!!! error TS1485: Octal escape sequences are not allowed in template strings. + \ No newline at end of file diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js new file mode 100644 index 0000000000000..b00260f6ee8fb --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js @@ -0,0 +1,240 @@ +//// [octalLiteralAndEscapeSequence.ts] +"use strict"; + +00; +05; +000; +005; +055; +`0${00}`; +`0${05}`; +`0${000}`; +`0${005}`; +`0${055}`; +`${00}0`; +`${05}0`; +`${000}0`; +`${005}0`; +`${055}0`; + +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; + +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; + +`\0`; +`\5`; +`\00`; +`\05`; +`\55`; +`\000`; +`\005`; +`\055`; +`${0}\0`; +`${0}\5`; +`${0}\00`; +`${0}\05`; +`${0}\55`; +`${0}\000`; +`${0}\005`; +`${0}\055`; +`\0${0}`; +`\5${0}`; +`\00${0}`; +`\05${0}`; +`\55${0}`; +`\000${0}`; +`\005${0}`; +`\055${0}`; +`${0}\0${0}`; +`${0}\5${0}`; +`${0}\00${0}`; +`${0}\05${0}`; +`${0}\55${0}`; +`${0}\000${0}`; +`${0}\005${0}`; +`${0}\055${0}`; + + +//// [octalLiteralAndEscapeSequence.js] +"use strict"; +00; +05; +000; +005; +055; +"0".concat(00); +"0".concat(05); +"0".concat(000); +"0".concat(005); +"0".concat(055); +"".concat(00, "0"); +"".concat(05, "0"); +"".concat(000, "0"); +"".concat(005, "0"); +"".concat(055, "0"); +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; +"\0"; +"\u0005"; +"\0"; +"\u0005"; +"-"; +"\0"; +"\u0005"; +"-"; +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "-"); +"".concat(0, "\0"); +"".concat(0, "\u0005"); +"".concat(0, "-"); +"\0".concat(0); +"\u0005".concat(0); +"\0".concat(0); +"\u0005".concat(0); +"-".concat(0); +"\0".concat(0); +"\u0005".concat(0); +"-".concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "-").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\u0005").concat(0); +"".concat(0, "-").concat(0); diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols new file mode 100644 index 0000000000000..0ba13e38f29d7 --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts === + +"use strict"; + +00; +05; +000; +005; +055; +`0${00}`; +`0${05}`; +`0${000}`; +`0${005}`; +`0${055}`; +`${00}0`; +`${05}0`; +`${000}0`; +`${005}0`; +`${055}0`; + +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; + +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; + +`\0`; +`\5`; +`\00`; +`\05`; +`\55`; +`\000`; +`\005`; +`\055`; +`${0}\0`; +`${0}\5`; +`${0}\00`; +`${0}\05`; +`${0}\55`; +`${0}\000`; +`${0}\005`; +`${0}\055`; +`\0${0}`; +`\5${0}`; +`\00${0}`; +`\05${0}`; +`\55${0}`; +`\000${0}`; +`\005${0}`; +`\055${0}`; +`${0}\0${0}`; +`${0}\5${0}`; +`${0}\00${0}`; +`${0}\05${0}`; +`${0}\55${0}`; +`${0}\000${0}`; +`${0}\005${0}`; +`${0}\055${0}`; + diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types new file mode 100644 index 0000000000000..c006384485d87 --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types @@ -0,0 +1,391 @@ +=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts === +"use strict"; +>"use strict" : "use strict" + +00; +>00 : 0 + +05; +>05 : 5 + +000; +>000 : 0 + +005; +>005 : 5 + +055; +>055 : 55 + +`0${00}`; +>`0${00}` : string +>00 : 0 + +`0${05}`; +>`0${05}` : string +>05 : 5 + +`0${000}`; +>`0${000}` : string +>000 : 0 + +`0${005}`; +>`0${005}` : string +>005 : 5 + +`0${055}`; +>`0${055}` : string +>055 : 55 + +`${00}0`; +>`${00}0` : string +>00 : 0 + +`${05}0`; +>`${05}0` : string +>05 : 5 + +`${000}0`; +>`${000}0` : string +>000 : 0 + +`${005}0`; +>`${005}0` : string +>005 : 5 + +`${055}0`; +>`${055}0` : string +>055 : 55 + +"\0"; +>"\0" : "\0" + +"\5"; +>"\5" : "\u0005" + +"\00"; +>"\00" : "\0" + +"\05"; +>"\05" : "\u0005" + +"\55"; +>"\55" : "-" + +"\000"; +>"\000" : "\0" + +"\005"; +>"\005" : "\u0005" + +"\055"; +>"\055" : "-" + +'\0'; +>'\0' : "\0" + +'\5'; +>'\5' : "\u0005" + +'\00'; +>'\00' : "\0" + +'\05'; +>'\05' : "\u0005" + +'\55'; +>'\55' : "-" + +'\000'; +>'\000' : "\0" + +'\005'; +>'\005' : "\u0005" + +'\055'; +>'\055' : "-" + +"\1"; +>"\1" : "\u0001" + +"\01"; +>"\01" : "\u0001" + +"\001"; +>"\001" : "\u0001" + +"\17"; +>"\17" : "\u000F" + +"\017"; +>"\017" : "\u000F" + +"\0017"; +>"\0017" : "\u00017" + +"\177"; +>"\177" : "" + +"\18"; +>"\18" : "\u00018" + +"\018"; +>"\018" : "\u00018" + +"\0018"; +>"\0018" : "\u00018" + +"\4"; +>"\4" : "\u0004" + +"\47"; +>"\47" : "'" + +"\047"; +>"\047" : "'" + +"\0047"; +>"\0047" : "\u00047" + +"\477"; +>"\477" : "'7" + +"\48"; +>"\48" : "\u00048" + +"\048"; +>"\048" : "\u00048" + +"\0048"; +>"\0048" : "\u00048" + +"\8"; +>"\8" : "\0" + +"\87"; +>"\87" : "\x007" + +"\087"; +>"\087" : "\x0087" + +"\0087"; +>"\0087" : "\x0087" + +"\877"; +>"\877" : "\x0077" + +"\88"; +>"\88" : "\x008" + +"\088"; +>"\088" : "\x0088" + +"\0088"; +>"\0088" : "\x0088" + +'\1'; +>'\1' : "\u0001" + +'\01'; +>'\01' : "\u0001" + +'\001'; +>'\001' : "\u0001" + +'\17'; +>'\17' : "\u000F" + +'\017'; +>'\017' : "\u000F" + +'\0017'; +>'\0017' : "\u00017" + +'\177'; +>'\177' : "" + +'\18'; +>'\18' : "\u00018" + +'\018'; +>'\018' : "\u00018" + +'\0018'; +>'\0018' : "\u00018" + +'\4'; +>'\4' : "\u0004" + +'\47'; +>'\47' : "'" + +'\047'; +>'\047' : "'" + +'\0047'; +>'\0047' : "\u00047" + +'\477'; +>'\477' : "'7" + +'\48'; +>'\48' : "\u00048" + +'\048'; +>'\048' : "\u00048" + +'\0048'; +>'\0048' : "\u00048" + +'\8'; +>'\8' : "\0" + +'\87'; +>'\87' : "\x007" + +'\087'; +>'\087' : "\x0087" + +'\0087'; +>'\0087' : "\x0087" + +'\877'; +>'\877' : "\x0077" + +'\88'; +>'\88' : "\x008" + +'\088'; +>'\088' : "\x0088" + +'\0088'; +>'\0088' : "\x0088" + +`\0`; +>`\0` : "\0" + +`\5`; +>`\5` : "\u0005" + +`\00`; +>`\00` : "\0" + +`\05`; +>`\05` : "\u0005" + +`\55`; +>`\55` : "-" + +`\000`; +>`\000` : "\0" + +`\005`; +>`\005` : "\u0005" + +`\055`; +>`\055` : "-" + +`${0}\0`; +>`${0}\0` : string +>0 : 0 + +`${0}\5`; +>`${0}\5` : string +>0 : 0 + +`${0}\00`; +>`${0}\00` : string +>0 : 0 + +`${0}\05`; +>`${0}\05` : string +>0 : 0 + +`${0}\55`; +>`${0}\55` : string +>0 : 0 + +`${0}\000`; +>`${0}\000` : string +>0 : 0 + +`${0}\005`; +>`${0}\005` : string +>0 : 0 + +`${0}\055`; +>`${0}\055` : string +>0 : 0 + +`\0${0}`; +>`\0${0}` : string +>0 : 0 + +`\5${0}`; +>`\5${0}` : string +>0 : 0 + +`\00${0}`; +>`\00${0}` : string +>0 : 0 + +`\05${0}`; +>`\05${0}` : string +>0 : 0 + +`\55${0}`; +>`\55${0}` : string +>0 : 0 + +`\000${0}`; +>`\000${0}` : string +>0 : 0 + +`\005${0}`; +>`\005${0}` : string +>0 : 0 + +`\055${0}`; +>`\055${0}` : string +>0 : 0 + +`${0}\0${0}`; +>`${0}\0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\5${0}`; +>`${0}\5${0}` : string +>0 : 0 +>0 : 0 + +`${0}\00${0}`; +>`${0}\00${0}` : string +>0 : 0 +>0 : 0 + +`${0}\05${0}`; +>`${0}\05${0}` : string +>0 : 0 +>0 : 0 + +`${0}\55${0}`; +>`${0}\55${0}` : string +>0 : 0 +>0 : 0 + +`${0}\000${0}`; +>`${0}\000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\005${0}`; +>`${0}\005${0}` : string +>0 : 0 +>0 : 0 + +`${0}\055${0}`; +>`${0}\055${0}` : string +>0 : 0 +>0 : 0 + diff --git a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt index 3c95b6cb556a2..ce569787913eb 100644 --- a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt +++ b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt @@ -1,8 +1,11 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts(2,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o3'. +tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts(2,1): error TS1121: Octal literals are not allowed in strict mode. -==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (2 errors) ==== "use strict"; 03; ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o3'. \ No newline at end of file +!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o3'. + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/parser.numericSeparators.unicodeEscape.js b/tests/baselines/reference/parser.numericSeparators.unicodeEscape.js index 13e8f2403e216..bc4a70f6ccd46 100644 --- a/tests/baselines/reference/parser.numericSeparators.unicodeEscape.js +++ b/tests/baselines/reference/parser.numericSeparators.unicodeEscape.js @@ -150,7 +150,7 @@ //// [2.js] '\u{10_ffff}'; //// [3.js] -"_ffff}"; +"\\u{10_ffff}"; //// [4.js] /\u{10_ffff}/u; //// [5.js] @@ -158,7 +158,7 @@ //// [6.js] '\uff_ff'; //// [7.js] -"_ff"; +"\\uff_ff"; //// [8.js] /\uff_ff/u; //// [9.js] @@ -166,7 +166,7 @@ //// [10.js] '\xf_f'; //// [11.js] -"_f"; +"\\xf_f"; //// [12.js] /\xf_f/u; //// [13.js] @@ -174,7 +174,7 @@ //// [14.js] '\u{_10ffff}'; //// [15.js] -"_10ffff}"; +"\\u{_10ffff}"; //// [16.js] /\u{_10ffff}/u; //// [17.js] @@ -182,7 +182,7 @@ //// [18.js] '\u_ffff'; //// [19.js] -"_ffff"; +"\\u_ffff"; //// [20.js] /\u_ffff/u; //// [21.js] @@ -190,7 +190,7 @@ //// [22.js] '\x_ff'; //// [23.js] -"_ff"; +"\\x_ff"; //// [24.js] /\x_ff/u; //// [25.js] @@ -198,7 +198,7 @@ //// [26.js] '\u{10ffff_}'; //// [27.js] -"_}"; +"\\u{10ffff_}"; //// [28.js] /\u{10ffff_}/u; //// [29.js] @@ -222,7 +222,7 @@ //// [38.js] '\u{10__ffff}'; //// [39.js] -"__ffff}"; +"\\u{10__ffff}"; //// [40.js] /\u{10__ffff}/u; //// [41.js] @@ -230,7 +230,7 @@ //// [42.js] '\uff__ff'; //// [43.js] -"__ff"; +"\\uff__ff"; //// [44.js] /\uff__ff/u; //// [45.js] @@ -238,6 +238,6 @@ //// [46.js] '\xf__f'; //// [47.js] -"__f"; +"\\xf__f"; //// [48.js] /\xf__f/u; diff --git a/tests/baselines/reference/parser.numericSeparators.unicodeEscape.types b/tests/baselines/reference/parser.numericSeparators.unicodeEscape.types index 6eeaec715b664..b3ce226d1d623 100644 --- a/tests/baselines/reference/parser.numericSeparators.unicodeEscape.types +++ b/tests/baselines/reference/parser.numericSeparators.unicodeEscape.types @@ -1,14 +1,14 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/1.ts === "\u{10_ffff}" ->"\u{10_ffff}" : "_ffff}" +>"\u{10_ffff}" : "\\u{10_ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/2.ts === '\u{10_ffff}' ->'\u{10_ffff}' : "_ffff}" +>'\u{10_ffff}' : "\\u{10_ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/3.ts === `\u{10_ffff}` ->`\u{10_ffff}` : "_ffff}" +>`\u{10_ffff}` : "\\u{10_ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/4.ts === /\u{10_ffff}/u @@ -16,15 +16,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/5.ts === "\uff_ff" ->"\uff_ff" : "_ff" +>"\uff_ff" : "\\uff_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/6.ts === '\uff_ff' ->'\uff_ff' : "_ff" +>'\uff_ff' : "\\uff_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/7.ts === `\uff_ff` ->`\uff_ff` : "_ff" +>`\uff_ff` : "\\uff_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/8.ts === /\uff_ff/u @@ -32,15 +32,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts === "\xf_f" ->"\xf_f" : "_f" +>"\xf_f" : "\\xf_f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/10.ts === '\xf_f' ->'\xf_f' : "_f" +>'\xf_f' : "\\xf_f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/11.ts === `\xf_f` ->`\xf_f` : "_f" +>`\xf_f` : "\\xf_f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/12.ts === /\xf_f/u @@ -48,15 +48,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/13.ts === "\u{_10ffff}" ->"\u{_10ffff}" : "_10ffff}" +>"\u{_10ffff}" : "\\u{_10ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/14.ts === '\u{_10ffff}' ->'\u{_10ffff}' : "_10ffff}" +>'\u{_10ffff}' : "\\u{_10ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/15.ts === `\u{_10ffff}` ->`\u{_10ffff}` : "_10ffff}" +>`\u{_10ffff}` : "\\u{_10ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts === /\u{_10ffff}/u @@ -64,15 +64,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/17.ts === "\u_ffff" ->"\u_ffff" : "_ffff" +>"\u_ffff" : "\\u_ffff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts === '\u_ffff' ->'\u_ffff' : "_ffff" +>'\u_ffff' : "\\u_ffff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/19.ts === `\u_ffff` ->`\u_ffff` : "_ffff" +>`\u_ffff` : "\\u_ffff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/20.ts === /\u_ffff/u @@ -80,15 +80,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/21.ts === "\x_ff" ->"\x_ff" : "_ff" +>"\x_ff" : "\\x_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/22.ts === '\x_ff' ->'\x_ff' : "_ff" +>'\x_ff' : "\\x_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/23.ts === `\x_ff` ->`\x_ff` : "_ff" +>`\x_ff` : "\\x_ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/24.ts === /\x_ff/u @@ -96,15 +96,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/25.ts === "\u{10ffff_}" ->"\u{10ffff_}" : "_}" +>"\u{10ffff_}" : "\\u{10ffff_}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/26.ts === '\u{10ffff_}' ->'\u{10ffff_}' : "_}" +>'\u{10ffff_}' : "\\u{10ffff_}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/27.ts === `\u{10ffff_}` ->`\u{10ffff_}` : "_}" +>`\u{10ffff_}` : "\\u{10ffff_}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/28.ts === /\u{10ffff_}/u @@ -144,15 +144,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/37.ts === "\u{10__ffff}" ->"\u{10__ffff}" : "__ffff}" +>"\u{10__ffff}" : "\\u{10__ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/38.ts === '\u{10__ffff}' ->'\u{10__ffff}' : "__ffff}" +>'\u{10__ffff}' : "\\u{10__ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/39.ts === `\u{10__ffff}` ->`\u{10__ffff}` : "__ffff}" +>`\u{10__ffff}` : "\\u{10__ffff}" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/40.ts === /\u{10__ffff}/u @@ -160,15 +160,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/41.ts === "\uff__ff" ->"\uff__ff" : "__ff" +>"\uff__ff" : "\\uff__ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts === '\uff__ff' ->'\uff__ff' : "__ff" +>'\uff__ff' : "\\uff__ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/43.ts === `\uff__ff` ->`\uff__ff` : "__ff" +>`\uff__ff` : "\\uff__ff" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts === /\uff__ff/u @@ -176,15 +176,15 @@ === tests/cases/conformance/parser/ecmascript2021/numericSeparators/45.ts === "\xf__f" ->"\xf__f" : "__f" +>"\xf__f" : "\\xf__f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/46.ts === '\xf__f' ->'\xf__f' : "__f" +>'\xf__f' : "\\xf__f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/47.ts === `\xf__f` ->`\xf__f` : "__f" +>`\xf__f` : "\\xf__f" === tests/cases/conformance/parser/ecmascript2021/numericSeparators/48.ts === /\xf__f/u diff --git a/tests/baselines/reference/plainJSBinderErrors.errors.txt b/tests/baselines/reference/plainJSBinderErrors.errors.txt index 44084cc1c14b5..1ebfcbcec214a 100644 --- a/tests/baselines/reference/plainJSBinderErrors.errors.txt +++ b/tests/baselines/reference/plainJSBinderErrors.errors.txt @@ -10,6 +10,7 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(18,16): error TS1102: 'dele tests/cases/conformance/salsa/plainJSBinderErrors.js(19,16): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(22,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(23,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode. +tests/cases/conformance/salsa/plainJSBinderErrors.js(26,27): error TS1121: Octal literals are not allowed in strict mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(27,9): error TS1101: 'with' statements are not allowed in strict mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(33,13): error TS1344: 'A label is not allowed here. tests/cases/conformance/salsa/plainJSBinderErrors.js(34,13): error TS1107: Jump target cannot cross function boundary. @@ -17,7 +18,7 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(39,7): error TS1215: Invali tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode. -==== tests/cases/conformance/salsa/plainJSBinderErrors.js (17 errors) ==== +==== tests/cases/conformance/salsa/plainJSBinderErrors.js (18 errors) ==== export default 12 ~~~~~~~~~~~~~~~~~ !!! error TS2528: A module cannot have multiple default exports. @@ -70,6 +71,8 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali } withOctal() { const redundant = 010 + ~~~ +!!! error TS1121: Octal literals are not allowed in strict mode. with (redundant) { ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. diff --git a/tests/baselines/reference/scannerS7.8.4_A7.1_T4.types b/tests/baselines/reference/scannerS7.8.4_A7.1_T4.types index bf40bf5cafec8..54d105fa52961 100644 --- a/tests/baselines/reference/scannerS7.8.4_A7.1_T4.types +++ b/tests/baselines/reference/scannerS7.8.4_A7.1_T4.types @@ -12,6 +12,6 @@ //CHECK# "\u000G" ->"\u000G" : "G" +>"\u000G" : "\\u000G" diff --git a/tests/baselines/reference/strictModeOctalLiterals.errors.txt b/tests/baselines/reference/strictModeOctalLiterals.errors.txt index 3d52e5323f2c8..9ab0bb3543991 100644 --- a/tests/baselines/reference/strictModeOctalLiterals.errors.txt +++ b/tests/baselines/reference/strictModeOctalLiterals.errors.txt @@ -1,17 +1,26 @@ tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(2,14): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(2,14): error TS1121: Octal literals are not allowed in strict mode. tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,16): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,16): error TS1121: Octal literals are not allowed in strict mode. tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,21): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,21): error TS1121: Octal literals are not allowed in strict mode. -==== tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts (3 errors) ==== +==== tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts (6 errors) ==== export enum E { A = 12 + 01 ~~ !!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. } const orbitol: 01 = 01 ~~ !!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. ~~ !!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. + ~~ +!!! error TS1121: Octal literals are not allowed in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsErrors.types b/tests/baselines/reference/stringLiteralsErrors.types index 993374fd51baa..255be326e7e75 100644 --- a/tests/baselines/reference/stringLiteralsErrors.types +++ b/tests/baselines/reference/stringLiteralsErrors.types @@ -50,19 +50,19 @@ var es8 = 'unterminated " // wrong unicode sequences var es9 = "\u00"; >es9 : string ->"\u00" : "" +>"\u00" : "\\u00" var es10 = "\u00GG"; >es10 : string ->"\u00GG" : "GG" +>"\u00GG" : "\\u00GG" var es11 = "\x0"; >es11 : string ->"\x0" : "" +>"\x0" : "\\x0" var es12 = "\xmm"; >es12 : string ->"\xmm" : "mm" +>"\xmm" : "\\xmm" // End of file var es13 = " diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.js b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.js index 31a0358973f17..7bc765732f443 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.js +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.js @@ -5,6 +5,10 @@ function f(...args: any[]) { f `\x0D${ "Interrupted CRLF" }\x0A`; //// [taggedTemplateStringsHexadecimalEscapesES6.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; function f(...args) { } -f `\x0D${"Interrupted CRLF"}\x0A`; +f(__makeTemplateObject(["\r", "\n"], ["\\x0D", "\\x0A"]), "Interrupted CRLF"); diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.js b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.js index 6ca5fa5b03ab9..cea26ceeef309 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.js +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.js @@ -5,6 +5,10 @@ function f(...args: any[]) { f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; //// [taggedTemplateStringsWithUnicodeEscapesES6.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; function f(...args) { } -f `'\u{1f4a9}'${" should be converted to "}'\uD83D\uDCA9'`; +f(__makeTemplateObject(["'\uD83D\uDCA9'", "'\uD83D\uDCA9'"], ["'\\u{1f4a9}'", "'\\uD83D\\uDCA9'"]), " should be converted to "); diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt new file mode 100644 index 0000000000000..913375feb53c7 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt @@ -0,0 +1,255 @@ +tests/cases/compiler/templateLiteralEscapeSequence.ts(5,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(6,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(7,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(8,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(10,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(11,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(12,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(13,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(15,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(16,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(17,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(18,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(20,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(21,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(22,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(23,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(25,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(26,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(27,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(28,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(30,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(31,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(32,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(33,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(35,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(36,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(37,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(38,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(40,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(41,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(42,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(43,9): error TS1125: Hexadecimal digit expected. + + +==== tests/cases/compiler/templateLiteralEscapeSequence.ts (32 errors) ==== + declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; + + "use strict"; + + `\u`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0`; + +!!! error TS1125: Hexadecimal digit expected. + `\u00`; + +!!! error TS1125: Hexadecimal digit expected. + `\u000`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0000`; + `\u{}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u{ffffff}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `\x`; + +!!! error TS1125: Hexadecimal digit expected. + `\x0`; + +!!! error TS1125: Hexadecimal digit expected. + `\x00`; + `${0}\u`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u00`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u000`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0000`; + `${0}\u{}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u{ffffff}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `${0}\x`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x0`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x00`; + `\u${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u00${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u000${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0000${0}`; + `\u{}${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u{ffffff}${0}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `\x${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\x0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\x00${0}`; + `${0}\u${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u00${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u000${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0000${0}`; + `${0}\u{}${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u{ffffff}${0}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `${0}\x${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x00${0}`; + + tag`\u`; + tag`\u0`; + tag`\u00`; + tag`\u000`; + tag`\u0000`; + tag`\u{}`; + tag`\u{ffffff}`; + tag`\x`; + tag`\x0`; + tag`\x00`; + tag`${0}\u`; + tag`${0}\u0`; + tag`${0}\u00`; + tag`${0}\u000`; + tag`${0}\u0000`; + tag`${0}\u{}`; + tag`${0}\u{ffffff}`; + tag`${0}\x`; + tag`${0}\x0`; + tag`${0}\x00`; + tag`\u${0}`; + tag`\u0${0}`; + tag`\u00${0}`; + tag`\u000${0}`; + tag`\u0000${0}`; + tag`\u{}${0}`; + tag`\u{ffffff}${0}`; + tag`\x${0}`; + tag`\x0${0}`; + tag`\x00${0}`; + tag`${0}\u${0}`; + tag`${0}\u0${0}`; + tag`${0}\u00${0}`; + tag`${0}\u000${0}`; + tag`${0}\u0000${0}`; + tag`${0}\u{}${0}`; + tag`${0}\u{ffffff}${0}`; + tag`${0}\x${0}`; + tag`${0}\x0${0}`; + tag`${0}\x00${0}`; + + tag`0${00}`; + tag`0${05}`; + tag`0${000}`; + tag`0${005}`; + tag`0${055}`; + tag`${00}0`; + tag`${05}0`; + tag`${000}0`; + tag`${005}0`; + tag`${055}0`; + tag`\0`; + tag`\5`; + tag`\00`; + tag`\05`; + tag`\55`; + tag`\000`; + tag`\005`; + tag`\055`; + tag`${0}\0`; + tag`${0}\5`; + tag`${0}\00`; + tag`${0}\05`; + tag`${0}\55`; + tag`${0}\000`; + tag`${0}\005`; + tag`${0}\055`; + tag`\0${0}`; + tag`\5${0}`; + tag`\00${0}`; + tag`\05${0}`; + tag`\55${0}`; + tag`\000${0}`; + tag`\005${0}`; + tag`\055${0}`; + tag`${0}\0${0}`; + tag`${0}\5${0}`; + tag`${0}\00${0}`; + tag`${0}\05${0}`; + tag`${0}\55${0}`; + tag`${0}\000${0}`; + tag`${0}\005${0}`; + tag`${0}\055${0}`; + + tag`\1`; + tag`\01`; + tag`\001`; + tag`\17`; + tag`\017`; + tag`\0017`; + tag`\177`; + tag`\18`; + tag`\018`; + tag`\0018`; + tag`\4`; + tag`\47`; + tag`\047`; + tag`\0047`; + tag`\477`; + tag`\48`; + tag`\048`; + tag`\0048`; + tag`\8`; + tag`\87`; + tag`\087`; + tag`\0087`; + tag`\877`; + tag`\88`; + tag`\088`; + tag`\0088`; + \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js new file mode 100644 index 0000000000000..31718d00f3aeb --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js @@ -0,0 +1,312 @@ +//// [templateLiteralEscapeSequence.ts] +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; + +"use strict"; + +`\u`; +`\u0`; +`\u00`; +`\u000`; +`\u0000`; +`\u{}`; +`\u{ffffff}`; +`\x`; +`\x0`; +`\x00`; +`${0}\u`; +`${0}\u0`; +`${0}\u00`; +`${0}\u000`; +`${0}\u0000`; +`${0}\u{}`; +`${0}\u{ffffff}`; +`${0}\x`; +`${0}\x0`; +`${0}\x00`; +`\u${0}`; +`\u0${0}`; +`\u00${0}`; +`\u000${0}`; +`\u0000${0}`; +`\u{}${0}`; +`\u{ffffff}${0}`; +`\x${0}`; +`\x0${0}`; +`\x00${0}`; +`${0}\u${0}`; +`${0}\u0${0}`; +`${0}\u00${0}`; +`${0}\u000${0}`; +`${0}\u0000${0}`; +`${0}\u{}${0}`; +`${0}\u{ffffff}${0}`; +`${0}\x${0}`; +`${0}\x0${0}`; +`${0}\x00${0}`; + +tag`\u`; +tag`\u0`; +tag`\u00`; +tag`\u000`; +tag`\u0000`; +tag`\u{}`; +tag`\u{ffffff}`; +tag`\x`; +tag`\x0`; +tag`\x00`; +tag`${0}\u`; +tag`${0}\u0`; +tag`${0}\u00`; +tag`${0}\u000`; +tag`${0}\u0000`; +tag`${0}\u{}`; +tag`${0}\u{ffffff}`; +tag`${0}\x`; +tag`${0}\x0`; +tag`${0}\x00`; +tag`\u${0}`; +tag`\u0${0}`; +tag`\u00${0}`; +tag`\u000${0}`; +tag`\u0000${0}`; +tag`\u{}${0}`; +tag`\u{ffffff}${0}`; +tag`\x${0}`; +tag`\x0${0}`; +tag`\x00${0}`; +tag`${0}\u${0}`; +tag`${0}\u0${0}`; +tag`${0}\u00${0}`; +tag`${0}\u000${0}`; +tag`${0}\u0000${0}`; +tag`${0}\u{}${0}`; +tag`${0}\u{ffffff}${0}`; +tag`${0}\x${0}`; +tag`${0}\x0${0}`; +tag`${0}\x00${0}`; + +tag`0${00}`; +tag`0${05}`; +tag`0${000}`; +tag`0${005}`; +tag`0${055}`; +tag`${00}0`; +tag`${05}0`; +tag`${000}0`; +tag`${005}0`; +tag`${055}0`; +tag`\0`; +tag`\5`; +tag`\00`; +tag`\05`; +tag`\55`; +tag`\000`; +tag`\005`; +tag`\055`; +tag`${0}\0`; +tag`${0}\5`; +tag`${0}\00`; +tag`${0}\05`; +tag`${0}\55`; +tag`${0}\000`; +tag`${0}\005`; +tag`${0}\055`; +tag`\0${0}`; +tag`\5${0}`; +tag`\00${0}`; +tag`\05${0}`; +tag`\55${0}`; +tag`\000${0}`; +tag`\005${0}`; +tag`\055${0}`; +tag`${0}\0${0}`; +tag`${0}\5${0}`; +tag`${0}\00${0}`; +tag`${0}\05${0}`; +tag`${0}\55${0}`; +tag`${0}\000${0}`; +tag`${0}\005${0}`; +tag`${0}\055${0}`; + +tag`\1`; +tag`\01`; +tag`\001`; +tag`\17`; +tag`\017`; +tag`\0017`; +tag`\177`; +tag`\18`; +tag`\018`; +tag`\0018`; +tag`\4`; +tag`\47`; +tag`\047`; +tag`\0047`; +tag`\477`; +tag`\48`; +tag`\048`; +tag`\0048`; +tag`\8`; +tag`\87`; +tag`\087`; +tag`\0087`; +tag`\877`; +tag`\88`; +tag`\088`; +tag`\0088`; + + +//// [templateLiteralEscapeSequence.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +"use strict"; +"\\u"; +"\\u0"; +"\\u00"; +"\\u000"; +"\0"; +"\\u{}"; +"\\u{ffffff}"; +"\\x"; +"\\x0"; +"\0"; +"".concat(0, "\\u"); +"".concat(0, "\\u0"); +"".concat(0, "\\u00"); +"".concat(0, "\\u000"); +"".concat(0, "\0"); +"".concat(0, "\\u{}"); +"".concat(0, "\\u{ffffff}"); +"".concat(0, "\\x"); +"".concat(0, "\\x0"); +"".concat(0, "\0"); +"\\u".concat(0); +"\\u0".concat(0); +"\\u00".concat(0); +"\\u000".concat(0); +"\0".concat(0); +"\\u{}".concat(0); +"\\u{ffffff}".concat(0); +"\\x".concat(0); +"\\x0".concat(0); +"\0".concat(0); +"".concat(0, "\\u").concat(0); +"".concat(0, "\\u0").concat(0); +"".concat(0, "\\u00").concat(0); +"".concat(0, "\\u000").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\\u{}").concat(0); +"".concat(0, "\\u{ffffff}").concat(0); +"".concat(0, "\\x").concat(0); +"".concat(0, "\\x0").concat(0); +"".concat(0, "\0").concat(0); +tag(__makeTemplateObject([void 0], ["\\u"])); +tag(__makeTemplateObject([void 0], ["\\u0"])); +tag(__makeTemplateObject([void 0], ["\\u00"])); +tag(__makeTemplateObject([void 0], ["\\u000"])); +tag(__makeTemplateObject(["\0"], ["\\u0000"])); +tag(__makeTemplateObject([void 0], ["\\u{}"])); +tag(__makeTemplateObject([void 0], ["\\u{ffffff}"])); +tag(__makeTemplateObject([void 0], ["\\x"])); +tag(__makeTemplateObject([void 0], ["\\x0"])); +tag(__makeTemplateObject(["\0"], ["\\x00"])); +tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 0); +tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u{}"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u{ffffff}"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 0); +tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u0", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u00", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u000", ""]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\u0000", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u{}", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u{ffffff}", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\x", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\x0", ""]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\x00", ""]), 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u0", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u00", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u000", ""]), 0, 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\u0000", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u{}", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u{ffffff}", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\x", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\x0", ""]), 0, 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\x00", ""]), 0, 0); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 00); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 05); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 000); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 005); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 055); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 00); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 05); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 000); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 005); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 055); +tag(__makeTemplateObject(["\0"], ["\\0"])); +tag(__makeTemplateObject([void 0], ["\\5"])); +tag(__makeTemplateObject([void 0], ["\\00"])); +tag(__makeTemplateObject([void 0], ["\\05"])); +tag(__makeTemplateObject([void 0], ["\\55"])); +tag(__makeTemplateObject([void 0], ["\\000"])); +tag(__makeTemplateObject([void 0], ["\\005"])); +tag(__makeTemplateObject([void 0], ["\\055"])); +tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\5"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\05"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\55"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\000"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\005"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\055"]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\0", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\5", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\00", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\05", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\55", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\000", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\005", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\055", ""]), 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\0", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\5", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\00", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\05", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\55", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\000", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\005", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\055", ""]), 0, 0); +tag(__makeTemplateObject([void 0], ["\\1"])); +tag(__makeTemplateObject([void 0], ["\\01"])); +tag(__makeTemplateObject([void 0], ["\\001"])); +tag(__makeTemplateObject([void 0], ["\\17"])); +tag(__makeTemplateObject([void 0], ["\\017"])); +tag(__makeTemplateObject([void 0], ["\\0017"])); +tag(__makeTemplateObject([void 0], ["\\177"])); +tag(__makeTemplateObject([void 0], ["\\18"])); +tag(__makeTemplateObject([void 0], ["\\018"])); +tag(__makeTemplateObject([void 0], ["\\0018"])); +tag(__makeTemplateObject([void 0], ["\\4"])); +tag(__makeTemplateObject([void 0], ["\\47"])); +tag(__makeTemplateObject([void 0], ["\\047"])); +tag(__makeTemplateObject([void 0], ["\\0047"])); +tag(__makeTemplateObject([void 0], ["\\477"])); +tag(__makeTemplateObject([void 0], ["\\48"])); +tag(__makeTemplateObject([void 0], ["\\048"])); +tag(__makeTemplateObject([void 0], ["\\0048"])); +tag(__makeTemplateObject([void 0], ["\\8"])); +tag(__makeTemplateObject([void 0], ["\\87"])); +tag(__makeTemplateObject([void 0], ["\\087"])); +tag(__makeTemplateObject([void 0], ["\\0087"])); +tag(__makeTemplateObject([void 0], ["\\877"])); +tag(__makeTemplateObject([void 0], ["\\88"])); +tag(__makeTemplateObject([void 0], ["\\088"])); +tag(__makeTemplateObject([void 0], ["\\0088"])); diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols new file mode 100644 index 0000000000000..0f9594827f459 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols @@ -0,0 +1,374 @@ +=== tests/cases/compiler/templateLiteralEscapeSequence.ts === +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) +>template : Symbol(template, Decl(templateLiteralEscapeSequence.ts, 0, 21)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>substitutions : Symbol(substitutions, Decl(templateLiteralEscapeSequence.ts, 0, 52)) + +"use strict"; + +`\u`; +`\u0`; +`\u00`; +`\u000`; +`\u0000`; +`\u{}`; +`\u{ffffff}`; +`\x`; +`\x0`; +`\x00`; +`${0}\u`; +`${0}\u0`; +`${0}\u00`; +`${0}\u000`; +`${0}\u0000`; +`${0}\u{}`; +`${0}\u{ffffff}`; +`${0}\x`; +`${0}\x0`; +`${0}\x00`; +`\u${0}`; +`\u0${0}`; +`\u00${0}`; +`\u000${0}`; +`\u0000${0}`; +`\u{}${0}`; +`\u{ffffff}${0}`; +`\x${0}`; +`\x0${0}`; +`\x00${0}`; +`${0}\u${0}`; +`${0}\u0${0}`; +`${0}\u00${0}`; +`${0}\u000${0}`; +`${0}\u0000${0}`; +`${0}\u{}${0}`; +`${0}\u{ffffff}${0}`; +`${0}\x${0}`; +`${0}\x0${0}`; +`${0}\x00${0}`; + +tag`\u`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{ffffff}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{ffffff}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{ffffff}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{ffffff}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${00}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${05}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${000}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${005}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${055}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${00}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${05}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${000}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${005}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${055}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\5`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\05`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\55`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\005`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\055`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\5`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\05`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\55`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\005`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\055`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\5${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\05${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\55${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\005${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\055${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\5${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\05${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\55${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\005${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\055${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\1`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\01`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\001`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\17`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\017`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0017`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\177`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\18`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\018`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0018`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\4`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\47`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\047`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0047`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\477`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\48`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\048`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0048`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\8`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\87`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\087`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0087`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\877`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\88`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\088`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0088`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types new file mode 100644 index 0000000000000..99f8e0c9ddec4 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types @@ -0,0 +1,791 @@ +=== tests/cases/compiler/templateLiteralEscapeSequence.ts === +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>template : TemplateStringsArray +>substitutions : any[] + +"use strict"; +>"use strict" : "use strict" + +`\u`; +>`\u` : "\\u" + +`\u0`; +>`\u0` : "\\u0" + +`\u00`; +>`\u00` : "\\u00" + +`\u000`; +>`\u000` : "\\u000" + +`\u0000`; +>`\u0000` : "\0" + +`\u{}`; +>`\u{}` : "\\u{}" + +`\u{ffffff}`; +>`\u{ffffff}` : "\\u{ffffff}" + +`\x`; +>`\x` : "\\x" + +`\x0`; +>`\x0` : "\\x0" + +`\x00`; +>`\x00` : "\0" + +`${0}\u`; +>`${0}\u` : string +>0 : 0 + +`${0}\u0`; +>`${0}\u0` : string +>0 : 0 + +`${0}\u00`; +>`${0}\u00` : string +>0 : 0 + +`${0}\u000`; +>`${0}\u000` : string +>0 : 0 + +`${0}\u0000`; +>`${0}\u0000` : string +>0 : 0 + +`${0}\u{}`; +>`${0}\u{}` : string +>0 : 0 + +`${0}\u{ffffff}`; +>`${0}\u{ffffff}` : string +>0 : 0 + +`${0}\x`; +>`${0}\x` : string +>0 : 0 + +`${0}\x0`; +>`${0}\x0` : string +>0 : 0 + +`${0}\x00`; +>`${0}\x00` : string +>0 : 0 + +`\u${0}`; +>`\u${0}` : string +>0 : 0 + +`\u0${0}`; +>`\u0${0}` : string +>0 : 0 + +`\u00${0}`; +>`\u00${0}` : string +>0 : 0 + +`\u000${0}`; +>`\u000${0}` : string +>0 : 0 + +`\u0000${0}`; +>`\u0000${0}` : string +>0 : 0 + +`\u{}${0}`; +>`\u{}${0}` : string +>0 : 0 + +`\u{ffffff}${0}`; +>`\u{ffffff}${0}` : string +>0 : 0 + +`\x${0}`; +>`\x${0}` : string +>0 : 0 + +`\x0${0}`; +>`\x0${0}` : string +>0 : 0 + +`\x00${0}`; +>`\x00${0}` : string +>0 : 0 + +`${0}\u${0}`; +>`${0}\u${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u0${0}`; +>`${0}\u0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u00${0}`; +>`${0}\u00${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u000${0}`; +>`${0}\u000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u0000${0}`; +>`${0}\u0000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u{}${0}`; +>`${0}\u{}${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u{ffffff}${0}`; +>`${0}\u{ffffff}${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x${0}`; +>`${0}\x${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x0${0}`; +>`${0}\x0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x00${0}`; +>`${0}\x00${0}` : string +>0 : 0 +>0 : 0 + +tag`\u`; +>tag`\u` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u` : "\\u" + +tag`\u0`; +>tag`\u0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0` : "\\u0" + +tag`\u00`; +>tag`\u00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u00` : "\\u00" + +tag`\u000`; +>tag`\u000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u000` : "\\u000" + +tag`\u0000`; +>tag`\u0000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0000` : "\0" + +tag`\u{}`; +>tag`\u{}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{}` : "\\u{}" + +tag`\u{ffffff}`; +>tag`\u{ffffff}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{ffffff}` : "\\u{ffffff}" + +tag`\x`; +>tag`\x` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x` : "\\x" + +tag`\x0`; +>tag`\x0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x0` : "\\x0" + +tag`\x00`; +>tag`\x00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x00` : "\0" + +tag`${0}\u`; +>tag`${0}\u` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u` : string +>0 : 0 + +tag`${0}\u0`; +>tag`${0}\u0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0` : string +>0 : 0 + +tag`${0}\u00`; +>tag`${0}\u00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u00` : string +>0 : 0 + +tag`${0}\u000`; +>tag`${0}\u000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u000` : string +>0 : 0 + +tag`${0}\u0000`; +>tag`${0}\u0000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0000` : string +>0 : 0 + +tag`${0}\u{}`; +>tag`${0}\u{}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{}` : string +>0 : 0 + +tag`${0}\u{ffffff}`; +>tag`${0}\u{ffffff}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{ffffff}` : string +>0 : 0 + +tag`${0}\x`; +>tag`${0}\x` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x` : string +>0 : 0 + +tag`${0}\x0`; +>tag`${0}\x0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x0` : string +>0 : 0 + +tag`${0}\x00`; +>tag`${0}\x00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x00` : string +>0 : 0 + +tag`\u${0}`; +>tag`\u${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u${0}` : string +>0 : 0 + +tag`\u0${0}`; +>tag`\u0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0${0}` : string +>0 : 0 + +tag`\u00${0}`; +>tag`\u00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u00${0}` : string +>0 : 0 + +tag`\u000${0}`; +>tag`\u000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u000${0}` : string +>0 : 0 + +tag`\u0000${0}`; +>tag`\u0000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0000${0}` : string +>0 : 0 + +tag`\u{}${0}`; +>tag`\u{}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{}${0}` : string +>0 : 0 + +tag`\u{ffffff}${0}`; +>tag`\u{ffffff}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{ffffff}${0}` : string +>0 : 0 + +tag`\x${0}`; +>tag`\x${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x${0}` : string +>0 : 0 + +tag`\x0${0}`; +>tag`\x0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x0${0}` : string +>0 : 0 + +tag`\x00${0}`; +>tag`\x00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x00${0}` : string +>0 : 0 + +tag`${0}\u${0}`; +>tag`${0}\u${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u0${0}`; +>tag`${0}\u0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u00${0}`; +>tag`${0}\u00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u00${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u000${0}`; +>tag`${0}\u000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u0000${0}`; +>tag`${0}\u0000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u{}${0}`; +>tag`${0}\u{}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{}${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u{ffffff}${0}`; +>tag`${0}\u{ffffff}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{ffffff}${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x${0}`; +>tag`${0}\x${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x0${0}`; +>tag`${0}\x0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x00${0}`; +>tag`${0}\x00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x00${0}` : string +>0 : 0 +>0 : 0 + +tag`0${00}`; +>tag`0${00}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${00}` : string +>00 : 0 + +tag`0${05}`; +>tag`0${05}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${05}` : string +>05 : 5 + +tag`0${000}`; +>tag`0${000}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${000}` : string +>000 : 0 + +tag`0${005}`; +>tag`0${005}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${005}` : string +>005 : 5 + +tag`0${055}`; +>tag`0${055}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${055}` : string +>055 : 55 + +tag`${00}0`; +>tag`${00}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${00}0` : string +>00 : 0 + +tag`${05}0`; +>tag`${05}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${05}0` : string +>05 : 5 + +tag`${000}0`; +>tag`${000}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${000}0` : string +>000 : 0 + +tag`${005}0`; +>tag`${005}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${005}0` : string +>005 : 5 + +tag`${055}0`; +>tag`${055}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${055}0` : string +>055 : 55 + +tag`\0`; +>tag`\0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0` : "\0" + +tag`\5`; +>tag`\5` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\5` : "\u0005" + +tag`\00`; +>tag`\00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\00` : "\0" + +tag`\05`; +>tag`\05` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\05` : "\u0005" + +tag`\55`; +>tag`\55` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\55` : "-" + +tag`\000`; +>tag`\000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\000` : "\0" + +tag`\005`; +>tag`\005` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\005` : "\u0005" + +tag`\055`; +>tag`\055` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\055` : "-" + +tag`${0}\0`; +>tag`${0}\0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\0` : string +>0 : 0 + +tag`${0}\5`; +>tag`${0}\5` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\5` : string +>0 : 0 + +tag`${0}\00`; +>tag`${0}\00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\00` : string +>0 : 0 + +tag`${0}\05`; +>tag`${0}\05` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\05` : string +>0 : 0 + +tag`${0}\55`; +>tag`${0}\55` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\55` : string +>0 : 0 + +tag`${0}\000`; +>tag`${0}\000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\000` : string +>0 : 0 + +tag`${0}\005`; +>tag`${0}\005` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\005` : string +>0 : 0 + +tag`${0}\055`; +>tag`${0}\055` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\055` : string +>0 : 0 + +tag`\0${0}`; +>tag`\0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0${0}` : string +>0 : 0 + +tag`\5${0}`; +>tag`\5${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\5${0}` : string +>0 : 0 + +tag`\00${0}`; +>tag`\00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\00${0}` : string +>0 : 0 + +tag`\05${0}`; +>tag`\05${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\05${0}` : string +>0 : 0 + +tag`\55${0}`; +>tag`\55${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\55${0}` : string +>0 : 0 + +tag`\000${0}`; +>tag`\000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\000${0}` : string +>0 : 0 + +tag`\005${0}`; +>tag`\005${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\005${0}` : string +>0 : 0 + +tag`\055${0}`; +>tag`\055${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\055${0}` : string +>0 : 0 + +tag`${0}\0${0}`; +>tag`${0}\0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\5${0}`; +>tag`${0}\5${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\5${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\00${0}`; +>tag`${0}\00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\00${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\05${0}`; +>tag`${0}\05${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\05${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\55${0}`; +>tag`${0}\55${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\55${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\000${0}`; +>tag`${0}\000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\005${0}`; +>tag`${0}\005${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\005${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\055${0}`; +>tag`${0}\055${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\055${0}` : string +>0 : 0 +>0 : 0 + +tag`\1`; +>tag`\1` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\1` : "\u0001" + +tag`\01`; +>tag`\01` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\01` : "\u0001" + +tag`\001`; +>tag`\001` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\001` : "\u0001" + +tag`\17`; +>tag`\17` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\17` : "\u000F" + +tag`\017`; +>tag`\017` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\017` : "\u000F" + +tag`\0017`; +>tag`\0017` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0017` : "\u00017" + +tag`\177`; +>tag`\177` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\177` : "" + +tag`\18`; +>tag`\18` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\18` : "\u00018" + +tag`\018`; +>tag`\018` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\018` : "\u00018" + +tag`\0018`; +>tag`\0018` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0018` : "\u00018" + +tag`\4`; +>tag`\4` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\4` : "\u0004" + +tag`\47`; +>tag`\47` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\47` : "'" + +tag`\047`; +>tag`\047` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\047` : "'" + +tag`\0047`; +>tag`\0047` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0047` : "\u00047" + +tag`\477`; +>tag`\477` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\477` : "'7" + +tag`\48`; +>tag`\48` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\48` : "\u00048" + +tag`\048`; +>tag`\048` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\048` : "\u00048" + +tag`\0048`; +>tag`\0048` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0048` : "\u00048" + +tag`\8`; +>tag`\8` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\8` : "\0" + +tag`\87`; +>tag`\87` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\87` : "\x007" + +tag`\087`; +>tag`\087` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\087` : "\x0087" + +tag`\0087`; +>tag`\0087` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0087` : "\x0087" + +tag`\877`; +>tag`\877` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\877` : "\x0077" + +tag`\88`; +>tag`\88` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\88` : "\x008" + +tag`\088`; +>tag`\088` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\088` : "\x0088" + +tag`\0088`; +>tag`\0088` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0088` : "\x0088" + diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt new file mode 100644 index 0000000000000..913375feb53c7 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt @@ -0,0 +1,255 @@ +tests/cases/compiler/templateLiteralEscapeSequence.ts(5,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(6,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(7,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(8,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(10,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(11,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(12,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(13,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(15,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(16,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(17,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(18,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(20,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(21,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(22,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(23,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(25,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(26,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(27,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(28,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(30,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(31,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(32,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(33,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(35,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(36,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(37,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(38,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(40,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(41,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(42,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(43,9): error TS1125: Hexadecimal digit expected. + + +==== tests/cases/compiler/templateLiteralEscapeSequence.ts (32 errors) ==== + declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; + + "use strict"; + + `\u`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0`; + +!!! error TS1125: Hexadecimal digit expected. + `\u00`; + +!!! error TS1125: Hexadecimal digit expected. + `\u000`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0000`; + `\u{}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u{ffffff}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `\x`; + +!!! error TS1125: Hexadecimal digit expected. + `\x0`; + +!!! error TS1125: Hexadecimal digit expected. + `\x00`; + `${0}\u`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u00`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u000`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0000`; + `${0}\u{}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u{ffffff}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `${0}\x`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x0`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x00`; + `\u${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u00${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u000${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u0000${0}`; + `\u{}${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\u{ffffff}${0}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `\x${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\x0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `\x00${0}`; + `${0}\u${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u00${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u000${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u0000${0}`; + `${0}\u{}${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\u{ffffff}${0}`; + +!!! error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. + `${0}\x${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x0${0}`; + +!!! error TS1125: Hexadecimal digit expected. + `${0}\x00${0}`; + + tag`\u`; + tag`\u0`; + tag`\u00`; + tag`\u000`; + tag`\u0000`; + tag`\u{}`; + tag`\u{ffffff}`; + tag`\x`; + tag`\x0`; + tag`\x00`; + tag`${0}\u`; + tag`${0}\u0`; + tag`${0}\u00`; + tag`${0}\u000`; + tag`${0}\u0000`; + tag`${0}\u{}`; + tag`${0}\u{ffffff}`; + tag`${0}\x`; + tag`${0}\x0`; + tag`${0}\x00`; + tag`\u${0}`; + tag`\u0${0}`; + tag`\u00${0}`; + tag`\u000${0}`; + tag`\u0000${0}`; + tag`\u{}${0}`; + tag`\u{ffffff}${0}`; + tag`\x${0}`; + tag`\x0${0}`; + tag`\x00${0}`; + tag`${0}\u${0}`; + tag`${0}\u0${0}`; + tag`${0}\u00${0}`; + tag`${0}\u000${0}`; + tag`${0}\u0000${0}`; + tag`${0}\u{}${0}`; + tag`${0}\u{ffffff}${0}`; + tag`${0}\x${0}`; + tag`${0}\x0${0}`; + tag`${0}\x00${0}`; + + tag`0${00}`; + tag`0${05}`; + tag`0${000}`; + tag`0${005}`; + tag`0${055}`; + tag`${00}0`; + tag`${05}0`; + tag`${000}0`; + tag`${005}0`; + tag`${055}0`; + tag`\0`; + tag`\5`; + tag`\00`; + tag`\05`; + tag`\55`; + tag`\000`; + tag`\005`; + tag`\055`; + tag`${0}\0`; + tag`${0}\5`; + tag`${0}\00`; + tag`${0}\05`; + tag`${0}\55`; + tag`${0}\000`; + tag`${0}\005`; + tag`${0}\055`; + tag`\0${0}`; + tag`\5${0}`; + tag`\00${0}`; + tag`\05${0}`; + tag`\55${0}`; + tag`\000${0}`; + tag`\005${0}`; + tag`\055${0}`; + tag`${0}\0${0}`; + tag`${0}\5${0}`; + tag`${0}\00${0}`; + tag`${0}\05${0}`; + tag`${0}\55${0}`; + tag`${0}\000${0}`; + tag`${0}\005${0}`; + tag`${0}\055${0}`; + + tag`\1`; + tag`\01`; + tag`\001`; + tag`\17`; + tag`\017`; + tag`\0017`; + tag`\177`; + tag`\18`; + tag`\018`; + tag`\0018`; + tag`\4`; + tag`\47`; + tag`\047`; + tag`\0047`; + tag`\477`; + tag`\48`; + tag`\048`; + tag`\0048`; + tag`\8`; + tag`\87`; + tag`\087`; + tag`\0087`; + tag`\877`; + tag`\88`; + tag`\088`; + tag`\0088`; + \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js new file mode 100644 index 0000000000000..31718d00f3aeb --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js @@ -0,0 +1,312 @@ +//// [templateLiteralEscapeSequence.ts] +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; + +"use strict"; + +`\u`; +`\u0`; +`\u00`; +`\u000`; +`\u0000`; +`\u{}`; +`\u{ffffff}`; +`\x`; +`\x0`; +`\x00`; +`${0}\u`; +`${0}\u0`; +`${0}\u00`; +`${0}\u000`; +`${0}\u0000`; +`${0}\u{}`; +`${0}\u{ffffff}`; +`${0}\x`; +`${0}\x0`; +`${0}\x00`; +`\u${0}`; +`\u0${0}`; +`\u00${0}`; +`\u000${0}`; +`\u0000${0}`; +`\u{}${0}`; +`\u{ffffff}${0}`; +`\x${0}`; +`\x0${0}`; +`\x00${0}`; +`${0}\u${0}`; +`${0}\u0${0}`; +`${0}\u00${0}`; +`${0}\u000${0}`; +`${0}\u0000${0}`; +`${0}\u{}${0}`; +`${0}\u{ffffff}${0}`; +`${0}\x${0}`; +`${0}\x0${0}`; +`${0}\x00${0}`; + +tag`\u`; +tag`\u0`; +tag`\u00`; +tag`\u000`; +tag`\u0000`; +tag`\u{}`; +tag`\u{ffffff}`; +tag`\x`; +tag`\x0`; +tag`\x00`; +tag`${0}\u`; +tag`${0}\u0`; +tag`${0}\u00`; +tag`${0}\u000`; +tag`${0}\u0000`; +tag`${0}\u{}`; +tag`${0}\u{ffffff}`; +tag`${0}\x`; +tag`${0}\x0`; +tag`${0}\x00`; +tag`\u${0}`; +tag`\u0${0}`; +tag`\u00${0}`; +tag`\u000${0}`; +tag`\u0000${0}`; +tag`\u{}${0}`; +tag`\u{ffffff}${0}`; +tag`\x${0}`; +tag`\x0${0}`; +tag`\x00${0}`; +tag`${0}\u${0}`; +tag`${0}\u0${0}`; +tag`${0}\u00${0}`; +tag`${0}\u000${0}`; +tag`${0}\u0000${0}`; +tag`${0}\u{}${0}`; +tag`${0}\u{ffffff}${0}`; +tag`${0}\x${0}`; +tag`${0}\x0${0}`; +tag`${0}\x00${0}`; + +tag`0${00}`; +tag`0${05}`; +tag`0${000}`; +tag`0${005}`; +tag`0${055}`; +tag`${00}0`; +tag`${05}0`; +tag`${000}0`; +tag`${005}0`; +tag`${055}0`; +tag`\0`; +tag`\5`; +tag`\00`; +tag`\05`; +tag`\55`; +tag`\000`; +tag`\005`; +tag`\055`; +tag`${0}\0`; +tag`${0}\5`; +tag`${0}\00`; +tag`${0}\05`; +tag`${0}\55`; +tag`${0}\000`; +tag`${0}\005`; +tag`${0}\055`; +tag`\0${0}`; +tag`\5${0}`; +tag`\00${0}`; +tag`\05${0}`; +tag`\55${0}`; +tag`\000${0}`; +tag`\005${0}`; +tag`\055${0}`; +tag`${0}\0${0}`; +tag`${0}\5${0}`; +tag`${0}\00${0}`; +tag`${0}\05${0}`; +tag`${0}\55${0}`; +tag`${0}\000${0}`; +tag`${0}\005${0}`; +tag`${0}\055${0}`; + +tag`\1`; +tag`\01`; +tag`\001`; +tag`\17`; +tag`\017`; +tag`\0017`; +tag`\177`; +tag`\18`; +tag`\018`; +tag`\0018`; +tag`\4`; +tag`\47`; +tag`\047`; +tag`\0047`; +tag`\477`; +tag`\48`; +tag`\048`; +tag`\0048`; +tag`\8`; +tag`\87`; +tag`\087`; +tag`\0087`; +tag`\877`; +tag`\88`; +tag`\088`; +tag`\0088`; + + +//// [templateLiteralEscapeSequence.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +"use strict"; +"\\u"; +"\\u0"; +"\\u00"; +"\\u000"; +"\0"; +"\\u{}"; +"\\u{ffffff}"; +"\\x"; +"\\x0"; +"\0"; +"".concat(0, "\\u"); +"".concat(0, "\\u0"); +"".concat(0, "\\u00"); +"".concat(0, "\\u000"); +"".concat(0, "\0"); +"".concat(0, "\\u{}"); +"".concat(0, "\\u{ffffff}"); +"".concat(0, "\\x"); +"".concat(0, "\\x0"); +"".concat(0, "\0"); +"\\u".concat(0); +"\\u0".concat(0); +"\\u00".concat(0); +"\\u000".concat(0); +"\0".concat(0); +"\\u{}".concat(0); +"\\u{ffffff}".concat(0); +"\\x".concat(0); +"\\x0".concat(0); +"\0".concat(0); +"".concat(0, "\\u").concat(0); +"".concat(0, "\\u0").concat(0); +"".concat(0, "\\u00").concat(0); +"".concat(0, "\\u000").concat(0); +"".concat(0, "\0").concat(0); +"".concat(0, "\\u{}").concat(0); +"".concat(0, "\\u{ffffff}").concat(0); +"".concat(0, "\\x").concat(0); +"".concat(0, "\\x0").concat(0); +"".concat(0, "\0").concat(0); +tag(__makeTemplateObject([void 0], ["\\u"])); +tag(__makeTemplateObject([void 0], ["\\u0"])); +tag(__makeTemplateObject([void 0], ["\\u00"])); +tag(__makeTemplateObject([void 0], ["\\u000"])); +tag(__makeTemplateObject(["\0"], ["\\u0000"])); +tag(__makeTemplateObject([void 0], ["\\u{}"])); +tag(__makeTemplateObject([void 0], ["\\u{ffffff}"])); +tag(__makeTemplateObject([void 0], ["\\x"])); +tag(__makeTemplateObject([void 0], ["\\x0"])); +tag(__makeTemplateObject(["\0"], ["\\x00"])); +tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 0); +tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u{}"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\u{ffffff}"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 0); +tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u0", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u00", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u000", ""]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\u0000", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u{}", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\u{ffffff}", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\x", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\x0", ""]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\x00", ""]), 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u0", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u00", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u000", ""]), 0, 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\u0000", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u{}", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\u{ffffff}", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\x", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\x0", ""]), 0, 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\x00", ""]), 0, 0); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 00); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 05); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 000); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 005); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 055); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 00); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 05); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 000); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 005); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 055); +tag(__makeTemplateObject(["\0"], ["\\0"])); +tag(__makeTemplateObject([void 0], ["\\5"])); +tag(__makeTemplateObject([void 0], ["\\00"])); +tag(__makeTemplateObject([void 0], ["\\05"])); +tag(__makeTemplateObject([void 0], ["\\55"])); +tag(__makeTemplateObject([void 0], ["\\000"])); +tag(__makeTemplateObject([void 0], ["\\005"])); +tag(__makeTemplateObject([void 0], ["\\055"])); +tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\5"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\05"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\55"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\000"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\005"]), 0); +tag(__makeTemplateObject(["", void 0], ["", "\\055"]), 0); +tag(__makeTemplateObject(["\0", ""], ["\\0", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\5", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\00", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\05", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\55", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\000", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\005", ""]), 0); +tag(__makeTemplateObject([void 0, ""], ["\\055", ""]), 0); +tag(__makeTemplateObject(["", "\0", ""], ["", "\\0", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\5", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\00", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\05", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\55", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\000", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\005", ""]), 0, 0); +tag(__makeTemplateObject(["", void 0, ""], ["", "\\055", ""]), 0, 0); +tag(__makeTemplateObject([void 0], ["\\1"])); +tag(__makeTemplateObject([void 0], ["\\01"])); +tag(__makeTemplateObject([void 0], ["\\001"])); +tag(__makeTemplateObject([void 0], ["\\17"])); +tag(__makeTemplateObject([void 0], ["\\017"])); +tag(__makeTemplateObject([void 0], ["\\0017"])); +tag(__makeTemplateObject([void 0], ["\\177"])); +tag(__makeTemplateObject([void 0], ["\\18"])); +tag(__makeTemplateObject([void 0], ["\\018"])); +tag(__makeTemplateObject([void 0], ["\\0018"])); +tag(__makeTemplateObject([void 0], ["\\4"])); +tag(__makeTemplateObject([void 0], ["\\47"])); +tag(__makeTemplateObject([void 0], ["\\047"])); +tag(__makeTemplateObject([void 0], ["\\0047"])); +tag(__makeTemplateObject([void 0], ["\\477"])); +tag(__makeTemplateObject([void 0], ["\\48"])); +tag(__makeTemplateObject([void 0], ["\\048"])); +tag(__makeTemplateObject([void 0], ["\\0048"])); +tag(__makeTemplateObject([void 0], ["\\8"])); +tag(__makeTemplateObject([void 0], ["\\87"])); +tag(__makeTemplateObject([void 0], ["\\087"])); +tag(__makeTemplateObject([void 0], ["\\0087"])); +tag(__makeTemplateObject([void 0], ["\\877"])); +tag(__makeTemplateObject([void 0], ["\\88"])); +tag(__makeTemplateObject([void 0], ["\\088"])); +tag(__makeTemplateObject([void 0], ["\\0088"])); diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols new file mode 100644 index 0000000000000..0f9594827f459 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols @@ -0,0 +1,374 @@ +=== tests/cases/compiler/templateLiteralEscapeSequence.ts === +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) +>template : Symbol(template, Decl(templateLiteralEscapeSequence.ts, 0, 21)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>substitutions : Symbol(substitutions, Decl(templateLiteralEscapeSequence.ts, 0, 52)) + +"use strict"; + +`\u`; +`\u0`; +`\u00`; +`\u000`; +`\u0000`; +`\u{}`; +`\u{ffffff}`; +`\x`; +`\x0`; +`\x00`; +`${0}\u`; +`${0}\u0`; +`${0}\u00`; +`${0}\u000`; +`${0}\u0000`; +`${0}\u{}`; +`${0}\u{ffffff}`; +`${0}\x`; +`${0}\x0`; +`${0}\x00`; +`\u${0}`; +`\u0${0}`; +`\u00${0}`; +`\u000${0}`; +`\u0000${0}`; +`\u{}${0}`; +`\u{ffffff}${0}`; +`\x${0}`; +`\x0${0}`; +`\x00${0}`; +`${0}\u${0}`; +`${0}\u0${0}`; +`${0}\u00${0}`; +`${0}\u000${0}`; +`${0}\u0000${0}`; +`${0}\u{}${0}`; +`${0}\u{ffffff}${0}`; +`${0}\x${0}`; +`${0}\x0${0}`; +`${0}\x00${0}`; + +tag`\u`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{ffffff}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{ffffff}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u0000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\u{ffffff}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\x00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u0000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\u{ffffff}${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\x00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${00}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${05}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${000}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${005}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`0${055}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${00}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${05}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${000}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${005}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${055}0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\5`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\05`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\55`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\005`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\055`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\0`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\5`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\00`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\05`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\55`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\000`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\005`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\055`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\5${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\05${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\55${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\005${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\055${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\0${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\5${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\00${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\05${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\55${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\000${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\005${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`${0}\055${0}`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\1`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\01`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\001`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\17`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\017`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0017`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\177`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\18`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\018`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0018`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\4`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\47`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\047`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0047`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\477`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\48`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\048`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0048`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\8`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\87`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\087`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0087`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\877`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\88`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\088`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + +tag`\0088`; +>tag : Symbol(tag, Decl(templateLiteralEscapeSequence.ts, 0, 0)) + diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types new file mode 100644 index 0000000000000..99f8e0c9ddec4 --- /dev/null +++ b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types @@ -0,0 +1,791 @@ +=== tests/cases/compiler/templateLiteralEscapeSequence.ts === +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>template : TemplateStringsArray +>substitutions : any[] + +"use strict"; +>"use strict" : "use strict" + +`\u`; +>`\u` : "\\u" + +`\u0`; +>`\u0` : "\\u0" + +`\u00`; +>`\u00` : "\\u00" + +`\u000`; +>`\u000` : "\\u000" + +`\u0000`; +>`\u0000` : "\0" + +`\u{}`; +>`\u{}` : "\\u{}" + +`\u{ffffff}`; +>`\u{ffffff}` : "\\u{ffffff}" + +`\x`; +>`\x` : "\\x" + +`\x0`; +>`\x0` : "\\x0" + +`\x00`; +>`\x00` : "\0" + +`${0}\u`; +>`${0}\u` : string +>0 : 0 + +`${0}\u0`; +>`${0}\u0` : string +>0 : 0 + +`${0}\u00`; +>`${0}\u00` : string +>0 : 0 + +`${0}\u000`; +>`${0}\u000` : string +>0 : 0 + +`${0}\u0000`; +>`${0}\u0000` : string +>0 : 0 + +`${0}\u{}`; +>`${0}\u{}` : string +>0 : 0 + +`${0}\u{ffffff}`; +>`${0}\u{ffffff}` : string +>0 : 0 + +`${0}\x`; +>`${0}\x` : string +>0 : 0 + +`${0}\x0`; +>`${0}\x0` : string +>0 : 0 + +`${0}\x00`; +>`${0}\x00` : string +>0 : 0 + +`\u${0}`; +>`\u${0}` : string +>0 : 0 + +`\u0${0}`; +>`\u0${0}` : string +>0 : 0 + +`\u00${0}`; +>`\u00${0}` : string +>0 : 0 + +`\u000${0}`; +>`\u000${0}` : string +>0 : 0 + +`\u0000${0}`; +>`\u0000${0}` : string +>0 : 0 + +`\u{}${0}`; +>`\u{}${0}` : string +>0 : 0 + +`\u{ffffff}${0}`; +>`\u{ffffff}${0}` : string +>0 : 0 + +`\x${0}`; +>`\x${0}` : string +>0 : 0 + +`\x0${0}`; +>`\x0${0}` : string +>0 : 0 + +`\x00${0}`; +>`\x00${0}` : string +>0 : 0 + +`${0}\u${0}`; +>`${0}\u${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u0${0}`; +>`${0}\u0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u00${0}`; +>`${0}\u00${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u000${0}`; +>`${0}\u000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u0000${0}`; +>`${0}\u0000${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u{}${0}`; +>`${0}\u{}${0}` : string +>0 : 0 +>0 : 0 + +`${0}\u{ffffff}${0}`; +>`${0}\u{ffffff}${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x${0}`; +>`${0}\x${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x0${0}`; +>`${0}\x0${0}` : string +>0 : 0 +>0 : 0 + +`${0}\x00${0}`; +>`${0}\x00${0}` : string +>0 : 0 +>0 : 0 + +tag`\u`; +>tag`\u` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u` : "\\u" + +tag`\u0`; +>tag`\u0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0` : "\\u0" + +tag`\u00`; +>tag`\u00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u00` : "\\u00" + +tag`\u000`; +>tag`\u000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u000` : "\\u000" + +tag`\u0000`; +>tag`\u0000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0000` : "\0" + +tag`\u{}`; +>tag`\u{}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{}` : "\\u{}" + +tag`\u{ffffff}`; +>tag`\u{ffffff}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{ffffff}` : "\\u{ffffff}" + +tag`\x`; +>tag`\x` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x` : "\\x" + +tag`\x0`; +>tag`\x0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x0` : "\\x0" + +tag`\x00`; +>tag`\x00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x00` : "\0" + +tag`${0}\u`; +>tag`${0}\u` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u` : string +>0 : 0 + +tag`${0}\u0`; +>tag`${0}\u0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0` : string +>0 : 0 + +tag`${0}\u00`; +>tag`${0}\u00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u00` : string +>0 : 0 + +tag`${0}\u000`; +>tag`${0}\u000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u000` : string +>0 : 0 + +tag`${0}\u0000`; +>tag`${0}\u0000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0000` : string +>0 : 0 + +tag`${0}\u{}`; +>tag`${0}\u{}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{}` : string +>0 : 0 + +tag`${0}\u{ffffff}`; +>tag`${0}\u{ffffff}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{ffffff}` : string +>0 : 0 + +tag`${0}\x`; +>tag`${0}\x` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x` : string +>0 : 0 + +tag`${0}\x0`; +>tag`${0}\x0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x0` : string +>0 : 0 + +tag`${0}\x00`; +>tag`${0}\x00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x00` : string +>0 : 0 + +tag`\u${0}`; +>tag`\u${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u${0}` : string +>0 : 0 + +tag`\u0${0}`; +>tag`\u0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0${0}` : string +>0 : 0 + +tag`\u00${0}`; +>tag`\u00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u00${0}` : string +>0 : 0 + +tag`\u000${0}`; +>tag`\u000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u000${0}` : string +>0 : 0 + +tag`\u0000${0}`; +>tag`\u0000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u0000${0}` : string +>0 : 0 + +tag`\u{}${0}`; +>tag`\u{}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{}${0}` : string +>0 : 0 + +tag`\u{ffffff}${0}`; +>tag`\u{ffffff}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\u{ffffff}${0}` : string +>0 : 0 + +tag`\x${0}`; +>tag`\x${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x${0}` : string +>0 : 0 + +tag`\x0${0}`; +>tag`\x0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x0${0}` : string +>0 : 0 + +tag`\x00${0}`; +>tag`\x00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\x00${0}` : string +>0 : 0 + +tag`${0}\u${0}`; +>tag`${0}\u${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u0${0}`; +>tag`${0}\u0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u00${0}`; +>tag`${0}\u00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u00${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u000${0}`; +>tag`${0}\u000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u0000${0}`; +>tag`${0}\u0000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u0000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u{}${0}`; +>tag`${0}\u{}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{}${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\u{ffffff}${0}`; +>tag`${0}\u{ffffff}${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\u{ffffff}${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x${0}`; +>tag`${0}\x${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x0${0}`; +>tag`${0}\x0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\x00${0}`; +>tag`${0}\x00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\x00${0}` : string +>0 : 0 +>0 : 0 + +tag`0${00}`; +>tag`0${00}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${00}` : string +>00 : 0 + +tag`0${05}`; +>tag`0${05}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${05}` : string +>05 : 5 + +tag`0${000}`; +>tag`0${000}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${000}` : string +>000 : 0 + +tag`0${005}`; +>tag`0${005}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${005}` : string +>005 : 5 + +tag`0${055}`; +>tag`0${055}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`0${055}` : string +>055 : 55 + +tag`${00}0`; +>tag`${00}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${00}0` : string +>00 : 0 + +tag`${05}0`; +>tag`${05}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${05}0` : string +>05 : 5 + +tag`${000}0`; +>tag`${000}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${000}0` : string +>000 : 0 + +tag`${005}0`; +>tag`${005}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${005}0` : string +>005 : 5 + +tag`${055}0`; +>tag`${055}0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${055}0` : string +>055 : 55 + +tag`\0`; +>tag`\0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0` : "\0" + +tag`\5`; +>tag`\5` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\5` : "\u0005" + +tag`\00`; +>tag`\00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\00` : "\0" + +tag`\05`; +>tag`\05` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\05` : "\u0005" + +tag`\55`; +>tag`\55` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\55` : "-" + +tag`\000`; +>tag`\000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\000` : "\0" + +tag`\005`; +>tag`\005` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\005` : "\u0005" + +tag`\055`; +>tag`\055` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\055` : "-" + +tag`${0}\0`; +>tag`${0}\0` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\0` : string +>0 : 0 + +tag`${0}\5`; +>tag`${0}\5` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\5` : string +>0 : 0 + +tag`${0}\00`; +>tag`${0}\00` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\00` : string +>0 : 0 + +tag`${0}\05`; +>tag`${0}\05` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\05` : string +>0 : 0 + +tag`${0}\55`; +>tag`${0}\55` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\55` : string +>0 : 0 + +tag`${0}\000`; +>tag`${0}\000` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\000` : string +>0 : 0 + +tag`${0}\005`; +>tag`${0}\005` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\005` : string +>0 : 0 + +tag`${0}\055`; +>tag`${0}\055` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\055` : string +>0 : 0 + +tag`\0${0}`; +>tag`\0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0${0}` : string +>0 : 0 + +tag`\5${0}`; +>tag`\5${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\5${0}` : string +>0 : 0 + +tag`\00${0}`; +>tag`\00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\00${0}` : string +>0 : 0 + +tag`\05${0}`; +>tag`\05${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\05${0}` : string +>0 : 0 + +tag`\55${0}`; +>tag`\55${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\55${0}` : string +>0 : 0 + +tag`\000${0}`; +>tag`\000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\000${0}` : string +>0 : 0 + +tag`\005${0}`; +>tag`\005${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\005${0}` : string +>0 : 0 + +tag`\055${0}`; +>tag`\055${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\055${0}` : string +>0 : 0 + +tag`${0}\0${0}`; +>tag`${0}\0${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\0${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\5${0}`; +>tag`${0}\5${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\5${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\00${0}`; +>tag`${0}\00${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\00${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\05${0}`; +>tag`${0}\05${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\05${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\55${0}`; +>tag`${0}\55${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\55${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\000${0}`; +>tag`${0}\000${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\000${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\005${0}`; +>tag`${0}\005${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\005${0}` : string +>0 : 0 +>0 : 0 + +tag`${0}\055${0}`; +>tag`${0}\055${0}` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`${0}\055${0}` : string +>0 : 0 +>0 : 0 + +tag`\1`; +>tag`\1` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\1` : "\u0001" + +tag`\01`; +>tag`\01` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\01` : "\u0001" + +tag`\001`; +>tag`\001` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\001` : "\u0001" + +tag`\17`; +>tag`\17` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\17` : "\u000F" + +tag`\017`; +>tag`\017` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\017` : "\u000F" + +tag`\0017`; +>tag`\0017` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0017` : "\u00017" + +tag`\177`; +>tag`\177` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\177` : "" + +tag`\18`; +>tag`\18` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\18` : "\u00018" + +tag`\018`; +>tag`\018` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\018` : "\u00018" + +tag`\0018`; +>tag`\0018` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0018` : "\u00018" + +tag`\4`; +>tag`\4` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\4` : "\u0004" + +tag`\47`; +>tag`\47` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\47` : "'" + +tag`\047`; +>tag`\047` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\047` : "'" + +tag`\0047`; +>tag`\0047` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0047` : "\u00047" + +tag`\477`; +>tag`\477` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\477` : "'7" + +tag`\48`; +>tag`\48` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\48` : "\u00048" + +tag`\048`; +>tag`\048` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\048` : "\u00048" + +tag`\0048`; +>tag`\0048` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0048` : "\u00048" + +tag`\8`; +>tag`\8` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\8` : "\0" + +tag`\87`; +>tag`\87` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\87` : "\x007" + +tag`\087`; +>tag`\087` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\087` : "\x0087" + +tag`\0087`; +>tag`\0087` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0087` : "\x0087" + +tag`\877`; +>tag`\877` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\877` : "\x0077" + +tag`\88`; +>tag`\88` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\88` : "\x008" + +tag`\088`; +>tag`\088` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\088` : "\x0088" + +tag`\0088`; +>tag`\0088` : string +>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string +>`\0088` : "\x0088" + diff --git a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js index 12b3d134c26e8..e4a00470f26db 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -710,6 +710,8 @@ Info 32 [00:01:13.000] response: "1477", "1478", "1479", + "1484", + "1485", "2200", "2201", "2202", @@ -2030,6 +2032,8 @@ Info 38 [00:01:19.000] response: "1477", "1478", "1479", + "1484", + "1485", "2200", "2201", "2202", @@ -3262,6 +3266,8 @@ Info 40 [00:01:21.000] response: "1477", "1478", "1479", + "1484", + "1485", "2200", "2201", "2202", diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.js index 7466d3360ece6..f998736126c6e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.js @@ -7,4 +7,4 @@ var x = "\u{110000}"; //// [unicodeExtendedEscapesInStrings07_ES5.js] // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. -var x = ""; +var x = "\u{110000}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.types index 8c584c284b26d..a656c003c2e1b 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES5.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = "\u{110000}"; >x : string ->"\u{110000}" : "" +>"\u{110000}" : "\\u{110000}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES6.types index 88b675df02751..b771d4be6533c 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings07_ES6.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = "\u{110000}"; >x : string ->"\u{110000}" : "" +>"\u{110000}" : "\\u{110000}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.js index 7171bcfbce0d9..761854f263148 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.js @@ -3,4 +3,4 @@ var x = "\u{FFFFFFFF}"; //// [unicodeExtendedEscapesInStrings12_ES5.js] -var x = ""; +var x = "\u{FFFFFFFF}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.types index 484161e8bf6bd..482dc4f6f21ec 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES5.ts === var x = "\u{FFFFFFFF}"; >x : string ->"\u{FFFFFFFF}" : "" +>"\u{FFFFFFFF}" : "\\u{FFFFFFFF}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES6.types index 64c4d06f1517b..bfdd68222e99a 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings12_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES6.ts === var x = "\u{FFFFFFFF}"; >x : string ->"\u{FFFFFFFF}" : "" +>"\u{FFFFFFFF}" : "\\u{FFFFFFFF}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.js index b21a69665cca9..0ab6d7c86a0d7 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.js @@ -5,4 +5,4 @@ var x = "\u{-DDDD}"; //// [unicodeExtendedEscapesInStrings14_ES5.js] // Shouldn't work, negatives are not allowed. -var x = "-DDDD}"; +var x = "\u{-DDDD}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.types index e7fa83de07c55..5d030cfc5b064 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES5.types @@ -2,5 +2,5 @@ // Shouldn't work, negatives are not allowed. var x = "\u{-DDDD}"; >x : string ->"\u{-DDDD}" : "-DDDD}" +>"\u{-DDDD}" : "\\u{-DDDD}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES6.types index 8d36d54698094..040bd4460d151 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings14_ES6.types @@ -2,5 +2,5 @@ // Shouldn't work, negatives are not allowed. var x = "\u{-DDDD}"; >x : string ->"\u{-DDDD}" : "-DDDD}" +>"\u{-DDDD}" : "\\u{-DDDD}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.js index 54884412869a6..b3d3b6f3e2698 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.js @@ -3,4 +3,4 @@ var x = "\u{r}\u{n}\u{t}"; //// [unicodeExtendedEscapesInStrings17_ES5.js] -var x = "r}n}t}"; +var x = "\u{r}\u{n}\u{t}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.types index d94125c286e18..c90fb632ffa6c 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings17_ES5.ts === var x = "\u{r}\u{n}\u{t}"; >x : string ->"\u{r}\u{n}\u{t}" : "r}n}t}" +>"\u{r}\u{n}\u{t}" : "\\u{r}\\u{n}\\u{t}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES6.types index 4e7bf02977e39..255f4d2251ef8 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings17_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings17_ES6.ts === var x = "\u{r}\u{n}\u{t}"; >x : string ->"\u{r}\u{n}\u{t}" : "r}n}t}" +>"\u{r}\u{n}\u{t}" : "\\u{r}\\u{n}\\u{t}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.js index 1732ed790951b..d6bdb5baf6fe7 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.js @@ -3,4 +3,4 @@ var x = "\u{}"; //// [unicodeExtendedEscapesInStrings19_ES5.js] -var x = ""; +var x = "\u{}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.types index 33cc76d4c2d0e..5a53af4b1c2d1 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings19_ES5.ts === var x = "\u{}"; >x : string ->"\u{}" : "" +>"\u{}" : "\\u{}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES6.types index 8a816139e124e..99eb525382e2e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings19_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings19_ES6.ts === var x = "\u{}"; >x : string ->"\u{}" : "" +>"\u{}" : "\\u{}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.js index 60139b83b64c1..a8855562fddea 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.js @@ -3,4 +3,4 @@ var x = "\u{"; //// [unicodeExtendedEscapesInStrings20_ES5.js] -var x = ""; +var x = "\u{"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.types index 75b464bc83587..091725f4aca43 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings20_ES5.ts === var x = "\u{"; >x : string ->"\u{" : "" +>"\u{" : "\\u{" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES6.types index 8b27e6233cca6..f4510dd506b37 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings20_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings20_ES6.ts === var x = "\u{"; >x : string ->"\u{" : "" +>"\u{" : "\\u{" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.js index 0aa2714334a63..f7087597255e8 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.js @@ -3,4 +3,4 @@ var x = "\u{67"; //// [unicodeExtendedEscapesInStrings21_ES5.js] -var x = ""; +var x = "\u{67"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.types index d080e3df2d1d6..256290b840680 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES5.ts === var x = "\u{67"; >x : string ->"\u{67" : "" +>"\u{67" : "\\u{67" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES6.types index 508b36033951e..0a5d6be1c1b04 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings21_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings21_ES6.ts === var x = "\u{67"; >x : string ->"\u{67" : "" +>"\u{67" : "\\u{67" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.js index 7693a111db9b8..4d20e5cb59862 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.js @@ -3,4 +3,4 @@ var x = "\u{00000000000067"; //// [unicodeExtendedEscapesInStrings22_ES5.js] -var x = ""; +var x = "\u{00000000000067"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.types index aa30496f4f2c6..d9271872fb281 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES5.ts === var x = "\u{00000000000067"; >x : string ->"\u{00000000000067" : "" +>"\u{00000000000067" : "\\u{00000000000067" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES6.types index e2b76e765464b..7741788844edd 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings22_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings22_ES6.ts === var x = "\u{00000000000067"; >x : string ->"\u{00000000000067" : "" +>"\u{00000000000067" : "\\u{00000000000067" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.js index 594646615e497..24fd9f4442cda 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.js @@ -3,4 +3,4 @@ var x = "\u{00000000000067 //// [unicodeExtendedEscapesInStrings24_ES5.js] -var x = ""; +var x = "\u{00000000000067; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.types index 6d64b25add097..a4b272b8d6080 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES5.ts === var x = "\u{00000000000067 >x : string ->"\u{00000000000067 : "" +>"\u{00000000000067 : "\\u{00000000000067" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES6.types index 7ae882089d222..dd55ee8f2b877 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInStrings24_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24_ES6.ts === var x = "\u{00000000000067 >x : string ->"\u{00000000000067 : "" +>"\u{00000000000067 : "\\u{00000000000067" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.js index 139bc8a731078..8dfd353f8cccc 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.js @@ -7,4 +7,4 @@ var x = `\u{110000}`; //// [unicodeExtendedEscapesInTemplates07_ES5.js] // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. -var x = ""; +var x = "\\u{110000}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.types index 1ad742857dcf1..de1dc366299a6 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES5.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = `\u{110000}`; >x : string ->`\u{110000}` : "" +>`\u{110000}` : "\\u{110000}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES6.types index 986e959798c5e..5d2400c65369b 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates07_ES6.types @@ -3,5 +3,5 @@ // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. var x = `\u{110000}`; >x : string ->`\u{110000}` : "" +>`\u{110000}` : "\\u{110000}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.js index 76b7d6de24568..bbfb004ddfae7 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.js @@ -3,4 +3,4 @@ var x = `\u{FFFFFFFF}`; //// [unicodeExtendedEscapesInTemplates12_ES5.js] -var x = ""; +var x = "\\u{FFFFFFFF}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.types index 6427cec705018..81d0f9bc6bb8e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES5.ts === var x = `\u{FFFFFFFF}`; >x : string ->`\u{FFFFFFFF}` : "" +>`\u{FFFFFFFF}` : "\\u{FFFFFFFF}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES6.types index f5952930f31b6..2df28ef94f229 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates12_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates12_ES6.ts === var x = `\u{FFFFFFFF}`; >x : string ->`\u{FFFFFFFF}` : "" +>`\u{FFFFFFFF}` : "\\u{FFFFFFFF}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.js index 7d33fe8e668e0..732d4c3376c58 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.js @@ -5,4 +5,4 @@ var x = `\u{-DDDD}`; //// [unicodeExtendedEscapesInTemplates14_ES5.js] // Shouldn't work, negatives are not allowed. -var x = "-DDDD}"; +var x = "\\u{-DDDD}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.types index 3b743b3e1a6cd..a9d5cb0ecfbbb 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES5.types @@ -2,5 +2,5 @@ // Shouldn't work, negatives are not allowed. var x = `\u{-DDDD}`; >x : string ->`\u{-DDDD}` : "-DDDD}" +>`\u{-DDDD}` : "\\u{-DDDD}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES6.types index 10b8e0bdc6541..e969300044f4e 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates14_ES6.types @@ -2,5 +2,5 @@ // Shouldn't work, negatives are not allowed. var x = `\u{-DDDD}`; >x : string ->`\u{-DDDD}` : "-DDDD}" +>`\u{-DDDD}` : "\\u{-DDDD}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.js index fb320097113d2..31f5557dc5446 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.js @@ -3,4 +3,4 @@ var x = `\u{r}\u{n}\u{t}`; //// [unicodeExtendedEscapesInTemplates17_ES5.js] -var x = "r}n}t}"; +var x = "\\u{r}\\u{n}\\u{t}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.types index 8a966d8acbbac..ecef83b261042 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates17_ES5.ts === var x = `\u{r}\u{n}\u{t}`; >x : string ->`\u{r}\u{n}\u{t}` : "r}n}t}" +>`\u{r}\u{n}\u{t}` : "\\u{r}\\u{n}\\u{t}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES6.types index cb2b1468f53c4..fe76350244f5f 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates17_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates17_ES6.ts === var x = `\u{r}\u{n}\u{t}`; >x : string ->`\u{r}\u{n}\u{t}` : "r}n}t}" +>`\u{r}\u{n}\u{t}` : "\\u{r}\\u{n}\\u{t}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.js index 635d7a71dd426..4ced1aa8b4d66 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.js @@ -3,4 +3,4 @@ var x = `\u{}`; //// [unicodeExtendedEscapesInTemplates19_ES5.js] -var x = ""; +var x = "\\u{}"; diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.types index 4e35c54d9c1d5..2646578853d26 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES5.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates19_ES5.ts === var x = `\u{}`; >x : string ->`\u{}` : "" +>`\u{}` : "\\u{}" diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES6.types index a2902c358d11e..78ce14cc50f62 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates19_ES6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates19_ES6.ts === var x = `\u{}`; >x : string ->`\u{}` : "" +>`\u{}` : "\\u{}" diff --git a/tests/cases/compiler/octalLiteralAndEscapeSequence.ts b/tests/cases/compiler/octalLiteralAndEscapeSequence.ts new file mode 100644 index 0000000000000..b7f939c030cdc --- /dev/null +++ b/tests/cases/compiler/octalLiteralAndEscapeSequence.ts @@ -0,0 +1,122 @@ +// @target: es3, es5 + +"use strict"; + +00; +05; +000; +005; +055; +`0${00}`; +`0${05}`; +`0${000}`; +`0${005}`; +`0${055}`; +`${00}0`; +`${05}0`; +`${000}0`; +`${005}0`; +`${055}0`; + +"\0"; +"\5"; +"\00"; +"\05"; +"\55"; +"\000"; +"\005"; +"\055"; +'\0'; +'\5'; +'\00'; +'\05'; +'\55'; +'\000'; +'\005'; +'\055'; + +"\1"; +"\01"; +"\001"; +"\17"; +"\017"; +"\0017"; +"\177"; +"\18"; +"\018"; +"\0018"; +"\4"; +"\47"; +"\047"; +"\0047"; +"\477"; +"\48"; +"\048"; +"\0048"; +"\8"; +"\87"; +"\087"; +"\0087"; +"\877"; +"\88"; +"\088"; +"\0088"; +'\1'; +'\01'; +'\001'; +'\17'; +'\017'; +'\0017'; +'\177'; +'\18'; +'\018'; +'\0018'; +'\4'; +'\47'; +'\047'; +'\0047'; +'\477'; +'\48'; +'\048'; +'\0048'; +'\8'; +'\87'; +'\087'; +'\0087'; +'\877'; +'\88'; +'\088'; +'\0088'; + +`\0`; +`\5`; +`\00`; +`\05`; +`\55`; +`\000`; +`\005`; +`\055`; +`${0}\0`; +`${0}\5`; +`${0}\00`; +`${0}\05`; +`${0}\55`; +`${0}\000`; +`${0}\005`; +`${0}\055`; +`\0${0}`; +`\5${0}`; +`\00${0}`; +`\05${0}`; +`\55${0}`; +`\000${0}`; +`\005${0}`; +`\055${0}`; +`${0}\0${0}`; +`${0}\5${0}`; +`${0}\00${0}`; +`${0}\05${0}`; +`${0}\55${0}`; +`${0}\000${0}`; +`${0}\005${0}`; +`${0}\055${0}`; diff --git a/tests/cases/compiler/templateLiteralEscapeSequence.ts b/tests/cases/compiler/templateLiteralEscapeSequence.ts new file mode 100644 index 0000000000000..c268074d659ae --- /dev/null +++ b/tests/cases/compiler/templateLiteralEscapeSequence.ts @@ -0,0 +1,157 @@ +// @target: es3, es5 + +declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; + +"use strict"; + +`\u`; +`\u0`; +`\u00`; +`\u000`; +`\u0000`; +`\u{}`; +`\u{ffffff}`; +`\x`; +`\x0`; +`\x00`; +`${0}\u`; +`${0}\u0`; +`${0}\u00`; +`${0}\u000`; +`${0}\u0000`; +`${0}\u{}`; +`${0}\u{ffffff}`; +`${0}\x`; +`${0}\x0`; +`${0}\x00`; +`\u${0}`; +`\u0${0}`; +`\u00${0}`; +`\u000${0}`; +`\u0000${0}`; +`\u{}${0}`; +`\u{ffffff}${0}`; +`\x${0}`; +`\x0${0}`; +`\x00${0}`; +`${0}\u${0}`; +`${0}\u0${0}`; +`${0}\u00${0}`; +`${0}\u000${0}`; +`${0}\u0000${0}`; +`${0}\u{}${0}`; +`${0}\u{ffffff}${0}`; +`${0}\x${0}`; +`${0}\x0${0}`; +`${0}\x00${0}`; + +tag`\u`; +tag`\u0`; +tag`\u00`; +tag`\u000`; +tag`\u0000`; +tag`\u{}`; +tag`\u{ffffff}`; +tag`\x`; +tag`\x0`; +tag`\x00`; +tag`${0}\u`; +tag`${0}\u0`; +tag`${0}\u00`; +tag`${0}\u000`; +tag`${0}\u0000`; +tag`${0}\u{}`; +tag`${0}\u{ffffff}`; +tag`${0}\x`; +tag`${0}\x0`; +tag`${0}\x00`; +tag`\u${0}`; +tag`\u0${0}`; +tag`\u00${0}`; +tag`\u000${0}`; +tag`\u0000${0}`; +tag`\u{}${0}`; +tag`\u{ffffff}${0}`; +tag`\x${0}`; +tag`\x0${0}`; +tag`\x00${0}`; +tag`${0}\u${0}`; +tag`${0}\u0${0}`; +tag`${0}\u00${0}`; +tag`${0}\u000${0}`; +tag`${0}\u0000${0}`; +tag`${0}\u{}${0}`; +tag`${0}\u{ffffff}${0}`; +tag`${0}\x${0}`; +tag`${0}\x0${0}`; +tag`${0}\x00${0}`; + +tag`0${00}`; +tag`0${05}`; +tag`0${000}`; +tag`0${005}`; +tag`0${055}`; +tag`${00}0`; +tag`${05}0`; +tag`${000}0`; +tag`${005}0`; +tag`${055}0`; +tag`\0`; +tag`\5`; +tag`\00`; +tag`\05`; +tag`\55`; +tag`\000`; +tag`\005`; +tag`\055`; +tag`${0}\0`; +tag`${0}\5`; +tag`${0}\00`; +tag`${0}\05`; +tag`${0}\55`; +tag`${0}\000`; +tag`${0}\005`; +tag`${0}\055`; +tag`\0${0}`; +tag`\5${0}`; +tag`\00${0}`; +tag`\05${0}`; +tag`\55${0}`; +tag`\000${0}`; +tag`\005${0}`; +tag`\055${0}`; +tag`${0}\0${0}`; +tag`${0}\5${0}`; +tag`${0}\00${0}`; +tag`${0}\05${0}`; +tag`${0}\55${0}`; +tag`${0}\000${0}`; +tag`${0}\005${0}`; +tag`${0}\055${0}`; + +tag`\1`; +tag`\01`; +tag`\001`; +tag`\17`; +tag`\017`; +tag`\0017`; +tag`\177`; +tag`\18`; +tag`\018`; +tag`\0018`; +tag`\4`; +tag`\47`; +tag`\047`; +tag`\0047`; +tag`\477`; +tag`\48`; +tag`\048`; +tag`\0048`; +tag`\8`; +tag`\87`; +tag`\087`; +tag`\0087`; +tag`\877`; +tag`\88`; +tag`\088`; +tag`\0088`;