From 51416df32927c122f3e6fcef38119933e08a2af3 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Fri, 9 Dec 2022 19:38:50 +0800 Subject: [PATCH 1/5] Literal and Escape Sequence --- src/compiler/binder.ts | 11 +- src/compiler/diagnosticMessages.json | 8 + src/compiler/factory/nodeFactory.ts | 3 +- 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, 6425 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 fc23222eb520b..535e0dc2baa66 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2565,8 +2565,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)); } } @@ -2815,6 +2822,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 ad3d9ec3e3eba..54cb5f7de2825 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 7b874d33be848..5740c21fb1c01 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -1112,10 +1112,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 b7c335f09efb6..fc371c0a4eb91 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2154,10 +2154,6 @@ namespace Parser { return currentToken = scanner.reScanTemplateToken(isTaggedTemplate); } - function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind { - return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate(); - } - function reScanLessThanToken(): SyntaxKind { return currentToken = scanner.reScanLessThanToken(); } @@ -3607,9 +3603,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; @@ -3631,14 +3625,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(); @@ -6315,7 +6308,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) { @@ -6415,10 +6408,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 22c785897f60c..29f91a785ab5b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2344,6 +2344,7 @@ export interface StringLiteral extends LiteralExpression, Declaration { * @internal */ readonly singleQuote?: boolean; + /** @internal */ readonly rangesOfOctalSequences?: ReadonlyTextRange[]; } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; @@ -2806,11 +2807,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 { @@ -8097,7 +8106,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 c314e60dcbf84..abef80008c4c8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8502,7 +8502,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 8f15e1cae0f9c..3664cf0f41693 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4567,7 +4567,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 cb8ce333a59cd..63e158198c903 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", @@ -2036,6 +2038,8 @@ Info 38 [00:01:19.000] response: "1477", "1478", "1479", + "1484", + "1485", "2200", "2201", "2202", @@ -3274,6 +3278,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`; From cecc6ef9ae9f1752d499067eb74674cf59a98844 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Wed, 14 Dec 2022 05:24:28 +0800 Subject: [PATCH 2/5] Remove strict mode and target check; Refactoring --- src/compiler/binder.ts | 19 - src/compiler/checker.ts | 28 +- src/compiler/diagnosticMessages.json | 22 +- src/compiler/factory/nodeFactory.ts | 3 +- src/compiler/parser.ts | 18 +- src/compiler/program.ts | 1 - src/compiler/scanner.ts | 134 ++- src/compiler/transformers/taggedTemplate.ts | 2 +- src/compiler/types.ts | 15 +- .../reference/api/tsserverlibrary.d.ts | 3 +- tests/baselines/reference/api/typescript.d.ts | 3 +- ...es3-oldStyleOctalLiteralInEnums.errors.txt | 8 +- .../es3-oldStyleOctalLiteralTypes.errors.txt | 8 +- .../es3-oldStyleOctalLiteralTypes.types | 8 +- ...es5-oldStyleOctalLiteralInEnums.errors.txt | 8 +- .../baselines/reference/isLiteral1.errors.txt | 4 +- tests/baselines/reference/isLiteral1.types | 2 +- .../baselines/reference/isLiteral2.errors.txt | 7 + tests/baselines/reference/isLiteral2.types | 2 +- ...CompilationBindStrictModeErrors.errors.txt | 11 +- ...sFileCompilationBindStrictModeErrors.types | 3 +- tests/baselines/reference/literals.errors.txt | 8 +- .../numberLiteralsWithLeadingZeros.errors.txt | 385 +++++++++ .../numberLiteralsWithLeadingZeros.js | 175 ++++ .../numberLiteralsWithLeadingZeros.symbols | 81 ++ .../numberLiteralsWithLeadingZeros.types | 232 +++++ .../reference/objectLiteralErrors.errors.txt | 138 +-- .../reference/objectLiteralErrors.symbols | 4 +- .../reference/objectLiteralErrors.types | 4 +- ...eWithStringNamedNumericProperty.errors.txt | 153 ++++ ...TypeWithStringNamedNumericProperty.symbols | 4 - ...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 ---------- .../octalLiteralAndEscapeSequence.errors.txt | 449 ++++++++++ ...5).js => octalLiteralAndEscapeSequence.js} | 3 - ... => octalLiteralAndEscapeSequence.symbols} | 2 - ...es => octalLiteralAndEscapeSequence.types} | 25 +- .../octalLiteralInStrictModeES3.errors.txt | 9 +- .../reference/parseBigInt.errors.txt | 5 +- tests/baselines/reference/parseBigInt.types | 4 +- ...mericSeparators.decmialNegative.errors.txt | 15 +- .../reference/plainJSBinderErrors.errors.txt | 24 +- .../reference/plainJSBinderErrors.types | 6 +- .../propertyAccessNumericLiterals.errors.txt | 12 + .../scannerES3NumericLiteral2.errors.txt | 4 +- .../scannerES3NumericLiteral3.errors.txt | 5 +- .../scannerNumericLiteral2.errors.txt | 4 +- .../scannerNumericLiteral3.errors.txt | 5 +- .../scannerNumericLiteral8.errors.txt | 4 +- .../scannerNumericLiteral9.errors.txt | 6 +- .../reference/scannerNumericLiteral9.js | 3 +- .../reference/scannerNumericLiteral9.types | 3 +- .../strictModeOctalLiterals.errors.txt | 23 +- ...mplateLiteralEscapeSequence(target=es3).js | 312 ------- ...teralEscapeSequence(target=es5).errors.txt | 255 ------ ...eLiteralEscapeSequence(target=es5).symbols | 374 --------- ...ateLiteralEscapeSequence(target=es5).types | 791 ------------------ ... templateLiteralEscapeSequence.errors.txt} | 98 ++- ...5).js => templateLiteralEscapeSequence.js} | 3 - ... => templateLiteralEscapeSequence.symbols} | 2 - ...es => templateLiteralEscapeSequence.types} | 73 +- .../getSupportedCodeFixes-can-be-proxied.js | 12 +- .../numberLiteralsWithLeadingZeros.ts | 78 ++ .../compiler/octalLiteralAndEscapeSequence.ts | 4 - .../compiler/templateLiteralEscapeSequence.ts | 4 - 68 files changed, 1909 insertions(+), 3857 deletions(-) create mode 100644 tests/baselines/reference/isLiteral2.errors.txt create mode 100644 tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt create mode 100644 tests/baselines/reference/numberLiteralsWithLeadingZeros.js create mode 100644 tests/baselines/reference/numberLiteralsWithLeadingZeros.symbols create mode 100644 tests/baselines/reference/numberLiteralsWithLeadingZeros.types create mode 100644 tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt delete mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt delete mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js delete mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols delete mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types delete mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt create mode 100644 tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt rename tests/baselines/reference/{octalLiteralAndEscapeSequence(target=es5).js => octalLiteralAndEscapeSequence.js} (94%) rename tests/baselines/reference/{octalLiteralAndEscapeSequence(target=es5).symbols => octalLiteralAndEscapeSequence.symbols} (88%) rename tests/baselines/reference/{octalLiteralAndEscapeSequence(target=es5).types => octalLiteralAndEscapeSequence.types} (85%) create mode 100644 tests/baselines/reference/propertyAccessNumericLiterals.errors.txt delete mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js delete mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt delete mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols delete mode 100644 tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types rename tests/baselines/reference/{templateLiteralEscapeSequence(target=es3).errors.txt => templateLiteralEscapeSequence.errors.txt} (56%) rename tests/baselines/reference/{templateLiteralEscapeSequence(target=es5).js => templateLiteralEscapeSequence.js} (98%) rename tests/baselines/reference/{templateLiteralEscapeSequence(target=es3).symbols => templateLiteralEscapeSequence.symbols} (96%) rename tests/baselines/reference/{templateLiteralEscapeSequence(target=es3).types => templateLiteralEscapeSequence.types} (91%) create mode 100644 tests/cases/compiler/numberLiteralsWithLeadingZeros.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 535e0dc2baa66..1e082e8b93aee 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -248,7 +248,6 @@ import { nodeIsPresent, NonNullChain, NonNullExpression, - NumericLiteral, objectAllocator, ObjectLiteralExpression, OptionalChain, @@ -293,7 +292,6 @@ import { TextRange, ThisExpression, ThrowStatement, - TokenFlags, tokenToString, tracing, TracingNode, @@ -2565,19 +2563,6 @@ 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) { - file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); - } - } - function checkStrictModePostfixUnaryExpression(node: PostfixUnaryExpression) { // Grammar checking // The identifier eval or arguments may not appear as the LeftHandSideExpression of an @@ -2822,10 +2807,6 @@ 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: return checkStrictModePostfixUnaryExpression(node as PostfixUnaryExpression); case SyntaxKind.PrefixUnaryExpression: diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a9572c993c51..257ce3178d0fc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -445,7 +445,6 @@ import { isCatchClause, isCatchClauseVariableDeclarationOrBindingElement, isCheckJsEnabledForFile, - isChildOfNodeWithKind, isClassDeclaration, isClassElement, isClassExpression, @@ -46944,33 +46943,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return false; } - function checkGrammarNumericLiteral(node: NumericLiteral): boolean { - // Grammar checking - if (node.numericLiteralFlags & TokenFlags.Octal) { - let diagnosticMessage: DiagnosticMessage | undefined; - if (languageVersion >= ScriptTarget.ES5) { - diagnosticMessage = Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; - } - else if (isChildOfNodeWithKind(node, SyntaxKind.LiteralType)) { - diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; - } - else if (isChildOfNodeWithKind(node, SyntaxKind.EnumMember)) { - diagnosticMessage = Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; - } - if (diagnosticMessage) { - const withMinus = isPrefixUnaryExpression(node.parent) && node.parent.operator === SyntaxKind.MinusToken; - const literal = (withMinus ? "-" : "") + "0o" + node.text; - return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); - } - } - + function checkGrammarNumericLiteral(node: NumericLiteral) { // Realism (size) checking - checkNumericLiteralValueSize(node); - - return false; - } - - function checkNumericLiteralValueSize(node: NumericLiteral) { // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "." // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`. const isFractional = getTextOfNode(node).indexOf(".") !== -1; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 54cb5f7de2825..5a007281a5e95 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -227,10 +227,6 @@ "category": "Error", "code": 1084 }, - "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'.": { - "category": "Error", - "code": 1085 - }, "'{0}' modifier cannot appear on a constructor declaration.": { "category": "Error", "code": 1089 @@ -351,7 +347,7 @@ "category": "Error", "code": 1120 }, - "Octal literals are not allowed in strict mode.": { + "Octal literals are not allowed. Use the syntax '{0}'.": { "category": "Error", "code": 1121 }, @@ -1549,14 +1545,18 @@ "category": "Message", "code": 1483 }, - "Octal escape sequences are not allowed in strict mode.": { + "Octal escape sequences are not allowed. Use the syntax '{0}'.": { "category": "Error", "code": 1484 }, - "Octal escape sequences are not allowed in template strings.": { + "'{0}' is not allowed.": { "category": "Error", "code": 1485 }, + "Decimals with leading zeros are not allowed.": { + "category": "Error", + "code": 1486 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", @@ -6372,14 +6372,6 @@ "category": "Error", "code": 8016 }, - "Octal literal types must use ES2015 syntax. Use the syntax '{0}'.": { - "category": "Error", - "code": 8017 - }, - "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'.": { - "category": "Error", - "code": 8018 - }, "Report errors in .js files.": { "category": "Message", "code": 8019 diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 5740c21fb1c01..7b874d33be848 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -1112,11 +1112,10 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode } // @api - function createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean, rangesOfOctalSequences?: ReadonlyTextRange[]): StringLiteral { + function createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean): 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 fc371c0a4eb91..e8de1c366ba20 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2098,8 +2098,8 @@ namespace Parser { parseErrorAt(range.pos, range.end, message, arg0); } - function scanError(message: DiagnosticMessage, length: number): void { - parseErrorAtPosition(scanner.getTextPos(), length, message); + function scanError(message: DiagnosticMessage, length: number, arg0?: any): void { + parseErrorAtPosition(scanner.getTextPos(), length, message, arg0); } function getNodePos(): number { @@ -2154,6 +2154,10 @@ namespace Parser { return currentToken = scanner.reScanTemplateToken(isTaggedTemplate); } + function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind { + return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate(); + } + function reScanLessThanToken(): SyntaxKind { return currentToken = scanner.reScanLessThanToken(); } @@ -3603,7 +3607,9 @@ namespace Parser { } function parseTemplateHead(isTaggedTemplate: boolean): TemplateHead { - reScanTemplateToken(isTaggedTemplate); + if (!isTaggedTemplate && scanner.getTokenFlags() & TokenFlags.ContainsInvalidEscape) { + reScanTemplateHeadOrNoSubstitutionTemplate(); + } const fragment = parseLiteralLikeNode(token()); Debug.assert(fragment.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind"); return fragment as TemplateHead; @@ -3631,7 +3637,7 @@ namespace Parser { // 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(), scanner.getRangesOfOctalSequences()) : + kind === SyntaxKind.StringLiteral ? factory.createStringLiteral(scanner.getTokenValue(), /*isSingleQuote*/ undefined, scanner.hasExtendedUnicodeEscape()) : isLiteralKind(kind) ? factory.createLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail(); @@ -6409,8 +6415,8 @@ namespace Parser { function parsePrimaryExpression(): PrimaryExpression { switch (token()) { case SyntaxKind.NoSubstitutionTemplateLiteral: - if (scanner.getTokenFlags() & TokenFlags.ContainsOctalOrInvalidEscape) { - reScanTemplateToken(/* isTaggedTemplate */ false); + if (scanner.getTokenFlags() & TokenFlags.ContainsInvalidEscape) { + reScanTemplateHeadOrNoSubstitutionTemplate(); } // falls through case SyntaxKind.NumericLiteral: diff --git a/src/compiler/program.ts b/src/compiler/program.ts index ee27160a182e9..33df5c83f336c 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1301,7 +1301,6 @@ export const plainJSErrors: Set = new Set([ Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, Diagnostics.Invalid_use_of_0_in_strict_mode.code, Diagnostics.A_label_is_not_allowed_here.code, - Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code, Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, // grammar errors Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index d6f87bc194883..805dd25bc9c30 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -19,9 +19,9 @@ import { LanguageVariant, LineAndCharacter, MapLike, + padLeft, parsePseudoBigInt, positionIsSynthesized, - ReadonlyTextRange, ScriptTarget, SourceFileLike, SyntaxKind, @@ -29,7 +29,7 @@ import { trimStringStart, } from "./_namespaces/ts"; -export type ErrorCallback = (message: DiagnosticMessage, length: number) => void; +export type ErrorCallback = (message: DiagnosticMessage, length: number, arg0?: any) => void; /** @internal */ export function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean { @@ -62,12 +62,11 @@ 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; @@ -986,7 +985,6 @@ export function createScanner(languageVersion: ScriptTarget, let token: SyntaxKind; let tokenValue!: string; let tokenFlags: TokenFlags; - let rangesOfOctalSequences: ReadonlyTextRange[]; let commentDirectives: CommentDirective[] | undefined; let inJSDocType = 0; @@ -1010,11 +1008,11 @@ export function createScanner(languageVersion: ScriptTarget, getCommentDirectives: () => commentDirectives, getNumericLiteralFlags: () => tokenFlags & TokenFlags.NumericLiteralFlags, getTokenFlags: () => tokenFlags, - getRangesOfOctalSequences: () => rangesOfOctalSequences, reScanGreaterToken, reScanAsteriskEqualsToken, reScanSlashToken, reScanTemplateToken, + reScanTemplateHeadOrNoSubstitutionTemplate, scanJsxIdentifier, scanJsxAttributeValue, reScanJsxAttributeValue, @@ -1051,12 +1049,12 @@ export function createScanner(languageVersion: ScriptTarget, return scanner; function error(message: DiagnosticMessage): void; - function error(message: DiagnosticMessage, errPos: number, length: number): void; - function error(message: DiagnosticMessage, errPos: number = pos, length?: number): void { + function error(message: DiagnosticMessage, errPos: number, length: number, arg0?: any): void; + function error(message: DiagnosticMessage, errPos: number = pos, length?: number, arg0?: any): void { if (onError) { const oldPos = pos; pos = errPos; - onError(message, length || 0); + onError(message, length || 0, arg0); pos = oldPos; } } @@ -1099,9 +1097,62 @@ export function createScanner(languageVersion: ScriptTarget, return result + text.substring(start, pos); } + // Extract from Section 12.9.3 + // NumericLiteral ::= + // | DecimalLiteral + // | DecimalBigIntegerLiteral + // | NonDecimalIntegerLiteral 'n'? + // | LegacyOctalIntegerLiteral + // DecimalBigIntegerLiteral ::= + // | '0n' + // | [1-9] DecimalDigits? 'n' + // | [1-9] '_' DecimalDigits 'n' + // DecimalLiteral ::= + // | DecimalIntegerLiteral? '.' DecimalDigits? ExponentPart? + // | '.' DecimalDigits ExponentPart? + // | DecimalIntegerLiteral ExponentPart? + // DecimalIntegerLiteral ::= + // | '0' + // | [1-9] '_'? DecimalDigits + // | NonOctalDecimalIntegerLiteral + // LegacyOctalIntegerLiteral ::= '0' [0-7]+ + // NonOctalDecimalIntegerLiteral ::= '0' [0-7]* [89] [0-9]* function scanNumber(): { type: SyntaxKind, value: string } { - const start = pos; - const mainFragment = scanNumberFragment(); + let start = pos; + let mainFragment: string; + let emitLeadingZeroError = false; + if (text.charCodeAt(pos) === CharacterCodes._0) { + pos++; + if (text.charCodeAt(pos) === CharacterCodes._) { + error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + // treat it as a normal number literal + pos--; + mainFragment = scanNumberFragment(); + } + // Separators are not allowed in the below cases + else if (!scanDigits()) { + // NonOctalDecimalIntegerLiteral, emit error later + // Separators in decimal and exponent parts are still allowed according to the spec + emitLeadingZeroError = true; + mainFragment = tokenValue; + } + else if (!tokenValue) { + // a single zero + mainFragment = "0"; + } + else { + // LegacyOctalIntegerLiteral + tokenValue = "0o" + tokenValue; + tokenFlags |= TokenFlags.Octal; + const withMinus = token === SyntaxKind.MinusToken; + start -= +withMinus; + error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, (withMinus ? "-" : "") + tokenValue); + return { type: SyntaxKind.NumericLiteral, value: tokenValue }; + } + } + else { + mainFragment = scanNumberFragment(); + } let decimalFragment: string | undefined; let scientificFragment: string | undefined; if (text.charCodeAt(pos) === CharacterCodes.dot) { @@ -1137,6 +1188,12 @@ export function createScanner(languageVersion: ScriptTarget, result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } + if (emitLeadingZeroError) { + error(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start, end - start); + // if a literal has a leading zero, it must not be bigint + return { type: SyntaxKind.NumericLiteral, value: result }; + } + if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & TokenFlags.Scientific)); return { @@ -1174,12 +1231,17 @@ export function createScanner(languageVersion: ScriptTarget, } } - function scanOctalDigits(): number { + function scanDigits(): boolean { const start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { + let isOctal = true; + while (isDigit(text.charCodeAt(pos))) { + if (!isOctalDigit(text.charCodeAt(pos))) { + isOctal = false; + } pos++; } - return +(text.substring(start, pos)); + tokenValue = text.substring(start, pos); + return isOctal; } /** @@ -1247,7 +1309,6 @@ export function createScanner(languageVersion: ScriptTarget, pos++; let result = ""; let start = pos; - rangesOfOctalSequences = []; while (true) { if (pos >= end) { result += text.substring(start, pos); @@ -1289,7 +1350,6 @@ export function createScanner(languageVersion: ScriptTarget, let start = pos; let contents = ""; let resultingToken: SyntaxKind; - rangesOfOctalSequences = []; while (true) { if (pos >= end) { @@ -1345,11 +1405,6 @@ 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; @@ -1389,14 +1444,23 @@ export function createScanner(languageVersion: ScriptTarget, if (pos < end && isOctalDigit(text.charCodeAt(pos))) { pos++; } - // '\47' - // falls through + // '\47' + tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + const code = parseInt(text.substring(start + 1, pos), 8); + error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start, pos - start, "\\x" + padLeft(code.toString(16), 2, "0")); + return String.fromCharCode(code); + } + return text.substring(start, pos); 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)); + tokenFlags |= TokenFlags.ContainsInvalidEscape; + if (shouldEmitInvalidEscapeError) { + error(Diagnostics._0_is_not_allowed, start, 2, text.substring(start, pos)); + return String.fromCharCode(ch); + } + return text.substring(start, pos); case CharacterCodes.b: return "\b"; case CharacterCodes.t: @@ -1937,15 +2001,6 @@ export function createScanner(languageVersion: ScriptTarget, tokenFlags |= TokenFlags.OctalSpecifier; return token = checkBigIntSuffix(); } - // Try to parse as an octal - if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - tokenFlags |= TokenFlags.Octal; - return token = SyntaxKind.NumericLiteral; - } - // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero - // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being - // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). // falls through case CharacterCodes._1: case CharacterCodes._2: @@ -2322,6 +2377,11 @@ export function createScanner(languageVersion: ScriptTarget, return token = scanTemplateAndSetTokenValue(!isTaggedTemplate); } + function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind { + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(/*shouldEmitInvalidEscapeError*/ true); + } + function reScanJsxToken(allowMultilineJsxText = true): JsxTokenSyntaxKind { pos = tokenPos = startPos; return token = scanJsxToken(allowMultilineJsxText); @@ -2574,7 +2634,6 @@ 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, @@ -2586,7 +2645,6 @@ export function createScanner(languageVersion: ScriptTarget, token = saveToken; tokenValue = saveTokenValue; tokenFlags = saveTokenFlags; - rangesOfOctalSequences = saveRangesOfOctalSequences; } return result; } @@ -2599,7 +2657,6 @@ export function createScanner(languageVersion: ScriptTarget, const saveToken = token; const saveTokenValue = tokenValue; const saveTokenFlags = tokenFlags; - const saveRangesOfOctalSequences = rangesOfOctalSequences; const saveErrorExpectations = commentDirectives; setText(text, start, length); @@ -2612,7 +2669,6 @@ 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 4140bf3dd6af9..c7a6e61da94da 100644 --- a/src/compiler/transformers/taggedTemplate.ts +++ b/src/compiler/transformers/taggedTemplate.ts @@ -94,7 +94,7 @@ export function processTaggedTemplateExpression( } function createTemplateCooked(template: TemplateHead | TemplateMiddle | TemplateTail | NoSubstitutionTemplateLiteral) { - return template.templateFlags! & TokenFlags.ContainsOctalOrInvalidEscape ? factory.createVoidZero() : factory.createStringLiteral(template.text); + return template.templateFlags! & TokenFlags.ContainsInvalidEscape ? factory.createVoidZero() : factory.createStringLiteral(template.text); } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 29f91a785ab5b..319a22a5748fd 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2344,7 +2344,6 @@ export interface StringLiteral extends LiteralExpression, Declaration { * @internal */ readonly singleQuote?: boolean; - /** @internal */ readonly rangesOfOctalSequences?: ReadonlyTextRange[]; } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; @@ -2803,23 +2802,19 @@ export const enum TokenFlags { /** @internal */ ContainsSeparator = 1 << 9, // e.g. `0b1100_0101` /** @internal */ - UnicodeEscape = 1 << 10, + UnicodeEscape = 1 << 10, // e.g. `\u00a0` /** @internal */ ContainsInvalidEscape = 1 << 11, // e.g. `\uhello` /** @internal */ - OctalEscape = 1 << 12, // e.g. `\1` - /** @internal */ - HexEscape = 1 << 13, // e.g. `\xa0` + HexEscape = 1 << 12, // e.g. `\xa0` /** @internal */ BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, /** @internal */ - StringLiteralFlags = OctalEscape | HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, + StringLiteralFlags = HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, /** @internal */ NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator, /** @internal */ - TemplateLiteralLikeFlags = OctalEscape | HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, - /** @internal */ - ContainsOctalOrInvalidEscape = OctalEscape | ContainsInvalidEscape, + TemplateLiteralLikeFlags = HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, } export interface NumericLiteral extends LiteralExpression, Declaration { @@ -8106,7 +8101,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, rangesOfOctalSequences?: ReadonlyTextRange[]): StringLiteral; // eslint-disable-line @typescript-eslint/unified-signatures + /** @internal */ createStringLiteral(text: string, isSingleQuote?: boolean, hasExtendedUnicodeEscape?: boolean): 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 abef80008c4c8..180bb03ceb3b3 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8484,7 +8484,7 @@ declare namespace ts { function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; - type ErrorCallback = (message: DiagnosticMessage, length: number) => void; + type ErrorCallback = (message: DiagnosticMessage, length: number, arg0?: any) => void; interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -8502,6 +8502,7 @@ 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 3664cf0f41693..d05d61b4abee3 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4549,7 +4549,7 @@ declare namespace ts { function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined, identifierVariant?: LanguageVariant): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; - type ErrorCallback = (message: DiagnosticMessage, length: number) => void; + type ErrorCallback = (message: DiagnosticMessage, length: number, arg0?: any) => void; interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -4567,6 +4567,7 @@ 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/es3-oldStyleOctalLiteralInEnums.errors.txt b/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt index 137b76f660d0a..ffce25833d30f 100644 --- a/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt +++ b/tests/baselines/reference/es3-oldStyleOctalLiteralInEnums.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(2,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '-0o1'. -tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(3,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '0o2'. +tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(2,7): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. +tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(3,7): error TS1121: Octal literals are not allowed. Use the syntax '0o2'. ==== tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts (2 errors) ==== enum E { x = -01, ~~~ -!!! error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '-0o1'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. y = 02, ~~ -!!! error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '0o2'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2'. } \ No newline at end of file diff --git a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt index 5fc9843989cec..7bb664459ea81 100644 --- a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt +++ b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(1,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'. -tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(2,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'. +tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(1,8): error TS1121: Octal literals are not allowed. Use the syntax '0o10'. +tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(2,8): error TS1121: Octal literals are not allowed. Use the syntax '-0o20'. ==== tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts (2 errors) ==== let x: 010; ~~~ -!!! error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o10'. let y: -020; ~~~~ -!!! error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o20'. \ No newline at end of file diff --git a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.types b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.types index 294963ed8c1a0..b4f9f311f5b1d 100644 --- a/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.types +++ b/tests/baselines/reference/es3-oldStyleOctalLiteralTypes.types @@ -1,9 +1,9 @@ === tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts === let x: 010; ->x : 10 +>x : 8 let y: -020; ->y : -20 ->-020 : -20 ->020 : 20 +>y : -16 +>-020 : -16 +>020 : 16 diff --git a/tests/baselines/reference/es5-oldStyleOctalLiteralInEnums.errors.txt b/tests/baselines/reference/es5-oldStyleOctalLiteralInEnums.errors.txt index a504568ce20fb..f34bcc83855a6 100644 --- a/tests/baselines/reference/es5-oldStyleOctalLiteralInEnums.errors.txt +++ b/tests/baselines/reference/es5-oldStyleOctalLiteralInEnums.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/es5-oldStyleOctalLiteralInEnums.ts(2,7): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o1'. -tests/cases/compiler/es5-oldStyleOctalLiteralInEnums.ts(3,7): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o2'. +tests/cases/compiler/es5-oldStyleOctalLiteralInEnums.ts(2,7): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. +tests/cases/compiler/es5-oldStyleOctalLiteralInEnums.ts(3,7): error TS1121: Octal literals are not allowed. Use the syntax '0o2'. ==== tests/cases/compiler/es5-oldStyleOctalLiteralInEnums.ts (2 errors) ==== enum E { x = -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. Use the syntax '-0o1'. y = 02, ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o2'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2'. } \ No newline at end of file diff --git a/tests/baselines/reference/isLiteral1.errors.txt b/tests/baselines/reference/isLiteral1.errors.txt index b967a4d0b4b27..fb30112708598 100644 --- a/tests/baselines/reference/isLiteral1.errors.txt +++ b/tests/baselines/reference/isLiteral1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/isLiteral1.ts(1,17): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o2343'. +tests/cases/compiler/isLiteral1.ts(1,17): error TS1121: Octal literals are not allowed. Use the syntax '0o2343'. ==== tests/cases/compiler/isLiteral1.ts (1 errors) ==== var x: number = 02343; ~~~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o2343'. \ No newline at end of file +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2343'. \ No newline at end of file diff --git a/tests/baselines/reference/isLiteral1.types b/tests/baselines/reference/isLiteral1.types index ae512e8bcb18a..4d9a694154175 100644 --- a/tests/baselines/reference/isLiteral1.types +++ b/tests/baselines/reference/isLiteral1.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral1.ts === var x: number = 02343; >x : number ->02343 : 2343 +>02343 : 1251 diff --git a/tests/baselines/reference/isLiteral2.errors.txt b/tests/baselines/reference/isLiteral2.errors.txt new file mode 100644 index 0000000000000..d3de022755602 --- /dev/null +++ b/tests/baselines/reference/isLiteral2.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/isLiteral2.ts(1,17): error TS1121: Octal literals are not allowed. Use the syntax '0o2343'. + + +==== tests/cases/compiler/isLiteral2.ts (1 errors) ==== + var x: number = 02343 + ~~~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2343'. \ No newline at end of file diff --git a/tests/baselines/reference/isLiteral2.types b/tests/baselines/reference/isLiteral2.types index 7ee40a962724a..302dae7570bfa 100644 --- a/tests/baselines/reference/isLiteral2.types +++ b/tests/baselines/reference/isLiteral2.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral2.ts === var x: number = 02343 >x : number ->02343 : 2343 +>02343 : 1251 diff --git a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt index 64fc50e8307c7..28121fd2a9be0 100644 --- a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt +++ b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.errors.txt @@ -10,8 +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. +tests/cases/compiler/d.js(2,9): error TS1486: Decimals with leading zeros are not allowed. ==== tests/cases/compiler/a.js (8 errors) ==== @@ -72,10 +71,8 @@ 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 (2 errors) ==== +==== tests/cases/compiler/d.js (1 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 + ~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.types b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.types index 4f59172ff9ace..814df00a7fc33 100644 --- a/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.types +++ b/tests/baselines/reference/jsFileCompilationBindStrictModeErrors.types @@ -79,6 +79,5 @@ var eval = function () { var x = 009; // error >x : number ->00 : 0 ->9 : 9 +>009 : 9 diff --git a/tests/baselines/reference/literals.errors.txt b/tests/baselines/reference/literals.errors.txt index 8f846c9cb3354..0d434c1fa5ead 100644 --- a/tests/baselines/reference/literals.errors.txt +++ b/tests/baselines/reference/literals.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/expressions/literals/literals.ts(8,10): error TS18050: T tests/cases/conformance/expressions/literals/literals.ts(8,17): error TS18050: The value 'null' cannot be used here. tests/cases/conformance/expressions/literals/literals.ts(9,9): error TS18050: The value 'undefined' cannot be used here. tests/cases/conformance/expressions/literals/literals.ts(9,21): error TS18050: The value 'undefined' cannot be used here. -tests/cases/conformance/expressions/literals/literals.ts(19,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. -tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o3'. +tests/cases/conformance/expressions/literals/literals.ts(19,9): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1121: Octal literals are not allowed. Use the syntax '-0o03'. ==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ==== @@ -35,14 +35,14 @@ tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1085: Oc var n = 1e4; var n = 001; // Error in ES5 ~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. var n = 0x1; var n = -1; var n = -1.0; var n = -1e-4; var n = -003; // Error in ES5 ~~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o3'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o03'. var n = -0x1; var s: string; diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt b/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt new file mode 100644 index 0000000000000..6068c33c41348 --- /dev/null +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt @@ -0,0 +1,385 @@ +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(3,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(5,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(6,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(8,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(8,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(9,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(9,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(10,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(10,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(12,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(13,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,3): error TS2304: Cannot find name 'e5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,4): error TS2304: Cannot find name 'e5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,3): error TS2304: Cannot find name 'e5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,4): error TS2304: Cannot find name 'e5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(19,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(20,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(22,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(22,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(23,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(23,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(24,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(24,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(26,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(27,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(29,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(29,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(30,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(30,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(31,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(31,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(33,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(34,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,3): error TS2304: Cannot find name 'e5_5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,4): error TS2304: Cannot find name 'e5_5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,3): error TS2304: Cannot find name 'e5_5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,4): error TS2304: Cannot find name 'e5_5'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(40,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(41,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(43,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(43,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(44,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(44,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(45,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(45,3): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,4): error TS1005: ';' expected. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(47,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(48,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(50,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(51,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(52,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(53,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(54,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(55,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(56,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(57,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(58,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(60,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(61,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(62,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(63,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(64,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(65,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(66,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(67,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(68,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(70,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(71,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(72,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(73,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(74,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(75,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(76,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(77,2): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Numeric separators are not allowed here. + + +==== tests/cases/compiler/numberLiteralsWithLeadingZeros.ts (101 errors) ==== + 00; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + 000; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + 01; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + 001; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + 08; + ~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008; + ~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00.5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~ +!!! error TS1005: ';' expected. + 000.5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~ +!!! error TS1005: ';' expected. + 01.5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~ +!!! error TS1005: ';' expected. + 001.5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~ +!!! error TS1005: ';' expected. + 08.5; + ~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008.5; + ~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00e5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e5'. + 000e5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e5'. + 01e5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e5'. + 001e5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'e5'. + 08e5; + ~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008e5; + ~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00.5e5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~~~ +!!! error TS1005: ';' expected. + 000.5e5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~~~ +!!! error TS1005: ';' expected. + 01.5e5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~~~ +!!! error TS1005: ';' expected. + 001.5e5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~~~ +!!! error TS1005: ';' expected. + 08.5e5; + ~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008.5e5; + ~~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00.5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~~~ +!!! error TS1005: ';' expected. + 000.5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~~~ +!!! error TS1005: ';' expected. + 01.5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~~~ +!!! error TS1005: ';' expected. + 001.5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~~~ +!!! error TS1005: ';' expected. + 08.5_5; + ~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008.5_5; + ~~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00e5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~~~ +!!! error TS1005: ';' expected. + ~~~~ +!!! error TS2304: Cannot find name 'e5_5'. + 000e5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~~~ +!!! error TS1005: ';' expected. + ~~~~ +!!! error TS2304: Cannot find name 'e5_5'. + 01e5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~~~ +!!! error TS1005: ';' expected. + ~~~~ +!!! error TS2304: Cannot find name 'e5_5'. + 001e5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~~~ +!!! error TS1005: ';' expected. + ~~~~ +!!! error TS2304: Cannot find name 'e5_5'. + 08e5_5; + ~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008e5_5; + ~~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 00.5_5e5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + ~~~~~~~~ +!!! error TS1005: ';' expected. + 000.5_5e5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + ~~~~~~~~ +!!! error TS1005: ';' expected. + 01.5_5e5_5; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + ~~~~~~~~ +!!! error TS1005: ';' expected. + 001.5_5e5_5; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. + ~~~~~~~~ +!!! error TS1005: ';' expected. + 08.5_5e5_5; + ~~~~~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 008.5_5e5_5; + ~~~~~~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + + 0_0.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_00.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_0.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_1.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_01.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_1.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_8.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_08.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_8.5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + + 0_0e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_00e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_0e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_1e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_01e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_1e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_8e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_08e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_8e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + + 0_0.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_00.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_0.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_1.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_01.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_1.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_8.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_08.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + 0_0_8.5_5e5_5; + ~ +!!! error TS6188: Numeric separators are not allowed here. + \ No newline at end of file diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.js b/tests/baselines/reference/numberLiteralsWithLeadingZeros.js new file mode 100644 index 0000000000000..967e6602bd865 --- /dev/null +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.js @@ -0,0 +1,175 @@ +//// [numberLiteralsWithLeadingZeros.ts] +00; +000; +01; +001; +08; +008; + +00.5; +000.5; +01.5; +001.5; +08.5; +008.5; + +00e5; +000e5; +01e5; +001e5; +08e5; +008e5; + +00.5e5; +000.5e5; +01.5e5; +001.5e5; +08.5e5; +008.5e5; + +00.5_5; +000.5_5; +01.5_5; +001.5_5; +08.5_5; +008.5_5; + +00e5_5; +000e5_5; +01e5_5; +001e5_5; +08e5_5; +008e5_5; + +00.5_5e5_5; +000.5_5e5_5; +01.5_5e5_5; +001.5_5e5_5; +08.5_5e5_5; +008.5_5e5_5; + +0_0.5_5; +0_00.5_5; +0_0_0.5_5; +0_1.5_5; +0_01.5_5; +0_0_1.5_5; +0_8.5_5; +0_08.5_5; +0_0_8.5_5; + +0_0e5_5; +0_00e5_5; +0_0_0e5_5; +0_1e5_5; +0_01e5_5; +0_0_1e5_5; +0_8e5_5; +0_08e5_5; +0_0_8e5_5; + +0_0.5_5e5_5; +0_00.5_5e5_5; +0_0_0.5_5e5_5; +0_1.5_5e5_5; +0_01.5_5e5_5; +0_0_1.5_5e5_5; +0_8.5_5e5_5; +0_08.5_5e5_5; +0_0_8.5_5e5_5; + + +//// [numberLiteralsWithLeadingZeros.js] +00; +000; +01; +001; +08; +008; +00; +.5; +000; +.5; +01; +.5; +001; +.5; +08.5; +008.5; +00; +e5; +000; +e5; +01; +e5; +001; +e5; +08e5; +008e5; +00; +.5e5; +000; +.5e5; +01; +.5e5; +001; +.5e5; +08.5e5; +008.5e5; +00; +0.55; +000; +0.55; +01; +0.55; +001; +0.55; +8.55; +08.55; +00; +e5_5; +000; +e5_5; +01; +e5_5; +001; +e5_5; +8e55; +08e55; +00; +5.5e+54; +000; +5.5e+54; +01; +5.5e+54; +001; +5.5e+54; +8.55e55; +08.55e55; +0.55; +0.55; +0.55; +1.55; +1.55; +1.55; +8.55; +8.55; +8.55; +0; +0; +0; +1e+55; +1e+55; +1e+55; +8e+55; +8e+55; +8e+55; +5.5e+54; +5.5e+54; +5.5e+54; +1.55e+55; +1.55e+55; +1.55e+55; +8.55e+55; +8.55e+55; +8.55e+55; diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.symbols b/tests/baselines/reference/numberLiteralsWithLeadingZeros.symbols new file mode 100644 index 0000000000000..f340b9a6e8eec --- /dev/null +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.symbols @@ -0,0 +1,81 @@ +=== tests/cases/compiler/numberLiteralsWithLeadingZeros.ts === + +00; +000; +01; +001; +08; +008; + +00.5; +000.5; +01.5; +001.5; +08.5; +008.5; + +00e5; +000e5; +01e5; +001e5; +08e5; +008e5; + +00.5e5; +000.5e5; +01.5e5; +001.5e5; +08.5e5; +008.5e5; + +00.5_5; +000.5_5; +01.5_5; +001.5_5; +08.5_5; +008.5_5; + +00e5_5; +000e5_5; +01e5_5; +001e5_5; +08e5_5; +008e5_5; + +00.5_5e5_5; +000.5_5e5_5; +01.5_5e5_5; +001.5_5e5_5; +08.5_5e5_5; +008.5_5e5_5; + +0_0.5_5; +0_00.5_5; +0_0_0.5_5; +0_1.5_5; +0_01.5_5; +0_0_1.5_5; +0_8.5_5; +0_08.5_5; +0_0_8.5_5; + +0_0e5_5; +0_00e5_5; +0_0_0e5_5; +0_1e5_5; +0_01e5_5; +0_0_1e5_5; +0_8e5_5; +0_08e5_5; +0_0_8e5_5; + +0_0.5_5e5_5; +0_00.5_5e5_5; +0_0_0.5_5e5_5; +0_1.5_5e5_5; +0_01.5_5e5_5; +0_0_1.5_5e5_5; +0_8.5_5e5_5; +0_08.5_5e5_5; +0_0_8.5_5e5_5; + diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.types b/tests/baselines/reference/numberLiteralsWithLeadingZeros.types new file mode 100644 index 0000000000000..a6eb675022199 --- /dev/null +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.types @@ -0,0 +1,232 @@ +=== tests/cases/compiler/numberLiteralsWithLeadingZeros.ts === +00; +>00 : 0 + +000; +>000 : 0 + +01; +>01 : 1 + +001; +>001 : 1 + +08; +>08 : 8 + +008; +>008 : 8 + +00.5; +>00 : 0 +>.5 : 0.5 + +000.5; +>000 : 0 +>.5 : 0.5 + +01.5; +>01 : 1 +>.5 : 0.5 + +001.5; +>001 : 1 +>.5 : 0.5 + +08.5; +>08.5 : 8.5 + +008.5; +>008.5 : 8.5 + +00e5; +>00 : 0 +>e5 : any + +000e5; +>000 : 0 +>e5 : any + +01e5; +>01 : 1 +>e5 : any + +001e5; +>001 : 1 +>e5 : any + +08e5; +>08e5 : 800000 + +008e5; +>008e5 : 800000 + +00.5e5; +>00 : 0 +>.5e5 : 50000 + +000.5e5; +>000 : 0 +>.5e5 : 50000 + +01.5e5; +>01 : 1 +>.5e5 : 50000 + +001.5e5; +>001 : 1 +>.5e5 : 50000 + +08.5e5; +>08.5e5 : 850000 + +008.5e5; +>008.5e5 : 850000 + +00.5_5; +>00 : 0 +>.5_5 : 0.55 + +000.5_5; +>000 : 0 +>.5_5 : 0.55 + +01.5_5; +>01 : 1 +>.5_5 : 0.55 + +001.5_5; +>001 : 1 +>.5_5 : 0.55 + +08.5_5; +>08.5_5 : 8.55 + +008.5_5; +>008.5_5 : 8.55 + +00e5_5; +>00 : 0 +>e5_5 : any + +000e5_5; +>000 : 0 +>e5_5 : any + +01e5_5; +>01 : 1 +>e5_5 : any + +001e5_5; +>001 : 1 +>e5_5 : any + +08e5_5; +>08e5_5 : 8e+55 + +008e5_5; +>008e5_5 : 8e+55 + +00.5_5e5_5; +>00 : 0 +>.5_5e5_5 : 5.5e+54 + +000.5_5e5_5; +>000 : 0 +>.5_5e5_5 : 5.5e+54 + +01.5_5e5_5; +>01 : 1 +>.5_5e5_5 : 5.5e+54 + +001.5_5e5_5; +>001 : 1 +>.5_5e5_5 : 5.5e+54 + +08.5_5e5_5; +>08.5_5e5_5 : 8.55e+55 + +008.5_5e5_5; +>008.5_5e5_5 : 8.55e+55 + +0_0.5_5; +>0_0.5_5 : 0.55 + +0_00.5_5; +>0_00.5_5 : 0.55 + +0_0_0.5_5; +>0_0_0.5_5 : 0.55 + +0_1.5_5; +>0_1.5_5 : 1.55 + +0_01.5_5; +>0_01.5_5 : 1.55 + +0_0_1.5_5; +>0_0_1.5_5 : 1.55 + +0_8.5_5; +>0_8.5_5 : 8.55 + +0_08.5_5; +>0_08.5_5 : 8.55 + +0_0_8.5_5; +>0_0_8.5_5 : 8.55 + +0_0e5_5; +>0_0e5_5 : 0 + +0_00e5_5; +>0_00e5_5 : 0 + +0_0_0e5_5; +>0_0_0e5_5 : 0 + +0_1e5_5; +>0_1e5_5 : 1e+55 + +0_01e5_5; +>0_01e5_5 : 1e+55 + +0_0_1e5_5; +>0_0_1e5_5 : 1e+55 + +0_8e5_5; +>0_8e5_5 : 8e+55 + +0_08e5_5; +>0_08e5_5 : 8e+55 + +0_0_8e5_5; +>0_0_8e5_5 : 8e+55 + +0_0.5_5e5_5; +>0_0.5_5e5_5 : 5.5e+54 + +0_00.5_5e5_5; +>0_00.5_5e5_5 : 5.5e+54 + +0_0_0.5_5e5_5; +>0_0_0.5_5e5_5 : 5.5e+54 + +0_1.5_5e5_5; +>0_1.5_5e5_5 : 1.55e+55 + +0_01.5_5e5_5; +>0_01.5_5e5_5 : 1.55e+55 + +0_0_1.5_5e5_5; +>0_0_1.5_5e5_5 : 1.55e+55 + +0_8.5_5e5_5; +>0_8.5_5e5_5 : 8.55e+55 + +0_08.5_5e5_5; +>0_08.5_5e5_5 : 8.55e+55 + +0_0_8.5_5e5_5; +>0_0_8.5_5e5_5 : 8.55e+55 + diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 972e2a5524150..2ad0919898813 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -1,269 +1,163 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(2,18): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,18): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,21): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,18): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,20): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,20): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,20): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,21): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,23): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,22): error TS1117: An object literal cannot have multiple properties with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,25): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'e14' must be of type '{ 0: number; }', but here has type '{ 0: number; "0o00": number; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,25): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,12): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,22): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,12): error TS2300: Duplicate identifier ''a''. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,24): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,12): error TS2300: Duplicate identifier ''a''. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS2300: Duplicate identifier '"a"'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,12): error TS2300: Duplicate identifier ''a''. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,13): error TS2300: Duplicate identifier '"a"'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,25): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,13): error TS2300: Duplicate identifier '1.0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS2300: Duplicate identifier ''1''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,13): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,13): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,13): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS2300: Duplicate identifier '0x0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,13): error TS2300: Duplicate identifier '0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS2300: Duplicate identifier '000'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f14' must be of type '{ readonly 0: number; }', but here has type '{ 0: number; readonly "0o00": number; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,13): error TS2300: Duplicate identifier '"100"'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,27): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,27): error TS2300: Duplicate identifier '1e2'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,13): error TS2300: Duplicate identifier '0x20'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,26): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,26): error TS2300: Duplicate identifier '3.2e1'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,13): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,46): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(42,16): error TS2380: The return type of a 'get' accessor must be assignable to its 'set' accessor type tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,22): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,16): error TS2380: The return type of a 'get' accessor must be assignable to its 'set' accessor type -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(48,7): error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(49,7): error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(50,5): error TS18016: Private identifiers are not allowed outside class bodies. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (79 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (41 errors) ==== // Multiple properties with the same name var e1 = { a: 0, a: 0 }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e2 = { a: '', a: '' }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e3 = { a: 0, a: '' }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e4 = { a: true, a: false }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e5 = { a: {}, a: {} }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e6 = { a: 0, 'a': 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e7 = { 'a': 0, a: 0 }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e8 = { 'a': 0, "a": 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e9 = { 'a': 0, 'a': 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e10 = { "a": 0, 'a': 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e11 = { 1.0: 0, '1': 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e12 = { 0: 0, 0: 0 }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e13 = { 0: 0, 0: 0 }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e14 = { 0: 0, 0x0: 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e14 = { 0: 0, 000: 0 }; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'e14' must be of type '{ 0: number; }', but here has type '{ 0: number; "0o00": number; }'. +!!! related TS6203 tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts:15:5: 'e14' was also declared here. ~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o0'. - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. var e15 = { "100": 0, 1e2: 0 }; - ~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e16 = { 0x20: 0, 3.2e1: 0 }; - ~~~~~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. var e17 = { a: 0, b: 1, a: 0 }; - ~ -!!! error TS1117: An object literal cannot have multiple properties with the same name. // Accessor and property with the same name var f1 = { a: 0, get a() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f2 = { a: '', get a() { return ''; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f3 = { a: 0, get a() { return ''; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f4 = { a: true, get a() { return false; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f5 = { a: {}, get a() { return {}; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f6 = { a: 0, get 'a'() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier ''a''. var f7 = { 'a': 0, get a() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. var f8 = { 'a': 0, get "a"() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier '"a"'. var f9 = { 'a': 0, get 'a'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier ''a''. var f10 = { "a": 0, get 'a'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier '"a"'. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier ''a''. var f11 = { 1.0: 0, get '1'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier '1.0'. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier ''1''. var f12 = { 0: 0, get 0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier '0'. var f13 = { 0: 0, get 0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier '0'. var f14 = { 0: 0, get 0x0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier '0x0'. var f14 = { 0: 0, get 000() { return 0; } }; - ~ -!!! error TS2300: Duplicate identifier '0'. - ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f14' must be of type '{ readonly 0: number; }', but here has type '{ 0: number; readonly "0o00": number; }'. +!!! related TS6203 tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts:35:5: 'f14' was also declared here. ~~~ -!!! error TS2300: Duplicate identifier '000'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. var f15 = { "100": 0, get 1e2() { return 0; } }; ~~~~~ !!! error TS2300: Duplicate identifier '"100"'. ~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~ !!! error TS2300: Duplicate identifier '1e2'. var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; ~~~~ !!! error TS2300: Duplicate identifier '0x20'. ~~~~~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~~~~~ !!! error TS2300: Duplicate identifier '3.2e1'. var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ -!!! error TS1119: An object literal cannot have property and accessor with the same name. - ~ !!! error TS2300: Duplicate identifier 'a'. // Get and set accessor with mismatched type annotations @@ -280,13 +174,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(50,5): // did you mean colon errors var h1 = { x = 1, - ~ -!!! error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. y = 2, - ~ -!!! error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. #z: 3 - ~~ -!!! error TS18016: Private identifiers are not allowed outside class bodies. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.symbols b/tests/baselines/reference/objectLiteralErrors.symbols index f2d19b661ebbb..020fb20dbc9bf 100644 --- a/tests/baselines/reference/objectLiteralErrors.symbols +++ b/tests/baselines/reference/objectLiteralErrors.symbols @@ -72,8 +72,8 @@ var e14 = { 0: 0, 0x0: 0 }; var e14 = { 0: 0, 000: 0 }; >e14 : Symbol(e14, Decl(objectLiteralErrors.ts, 14, 3), Decl(objectLiteralErrors.ts, 15, 3)) ->0 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11), Decl(objectLiteralErrors.ts, 15, 17)) ->000 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11), Decl(objectLiteralErrors.ts, 15, 17)) +>0 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11)) +>000 : Symbol(000, Decl(objectLiteralErrors.ts, 15, 17)) var e15 = { "100": 0, 1e2: 0 }; >e15 : Symbol(e15, Decl(objectLiteralErrors.ts, 16, 3)) diff --git a/tests/baselines/reference/objectLiteralErrors.types b/tests/baselines/reference/objectLiteralErrors.types index 47631d9b1aed3..59fbc7c18af56 100644 --- a/tests/baselines/reference/objectLiteralErrors.types +++ b/tests/baselines/reference/objectLiteralErrors.types @@ -114,7 +114,7 @@ var e14 = { 0: 0, 0x0: 0 }; var e14 = { 0: 0, 000: 0 }; >e14 : { 0: number; } ->{ 0: 0, 000: 0 } : { 0: number; } +>{ 0: 0, 000: 0 } : { 0: number; "0o00": number; } >0 : number >0 : 0 >000 : number @@ -261,7 +261,7 @@ var f14 = { 0: 0, get 0x0() { return 0; } }; var f14 = { 0: 0, get 000() { return 0; } }; >f14 : { readonly 0: number; } ->{ 0: 0, get 000() { return 0; } } : { readonly 0: number; } +>{ 0: 0, get 000() { return 0; } } : { 0: number; readonly "0o00": number; } >0 : number >0 : 0 >000 : number diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt new file mode 100644 index 0000000000000..eee32dc697a2e --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.errors.txt @@ -0,0 +1,153 @@ +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(33,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(34,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(64,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(65,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(94,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(95,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(124,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(125,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. + + +==== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts (8 errors) ==== + // string named numeric properties are legal and distinct when indexed by string values + // indexed numerically the value is converted to a number + // no errors expected below + + class C { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; + } + + var c: C; + var r1 = c['0.1']; + var r2 = c['.1']; + var r3 = c['1']; + var r3 = c[1]; + var r4 = c['1.']; + var r3 = c[1.]; // same as indexing by 1 when done numerically + var r5 = c['1..']; + var r6 = c['1.0']; + var r3 = c[1.0]; // same as indexing by 1 when done numerically + // BUG 823822 + var r7 = i[-1]; + var r7 = i[-1.0]; + var r8 = i["-1.0"]; + var r9 = i["-1"]; + var r10 = i[0x1] + var r11 = i[-0x1] + var r12 = i[01] + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + var r13 = i[-01] + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. + + interface I { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; + } + + var i: I; + var r1 = i['0.1']; + var r2 = i['.1']; + var r3 = i['1']; + var r3 = c[1]; + var r4 = i['1.']; + var r3 = c[1.]; // same as indexing by 1 when done numerically + var r5 = i['1..']; + var r6 = i['1.0']; + var r3 = c[1.0]; // same as indexing by 1 when done numerically + // BUG 823822 + var r7 = i[-1]; + var r7 = i[-1.0]; + var r8 = i["-1.0"]; + var r9 = i["-1"]; + var r10 = i[0x1] + var r11 = i[-0x1] + var r12 = i[01] + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + var r13 = i[-01] + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. + + var a: { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; + } + + var r1 = a['0.1']; + var r2 = a['.1']; + var r3 = a['1']; + var r3 = c[1]; + var r4 = a['1.']; + var r3 = c[1.]; // same as indexing by 1 when done numerically + var r5 = a['1..']; + var r6 = a['1.0']; + var r3 = c[1.0]; // same as indexing by 1 when done numerically + // BUG 823822 + var r7 = i[-1]; + var r7 = i[-1.0]; + var r8 = i["-1.0"]; + var r9 = i["-1"]; + var r10 = i[0x1] + var r11 = i[-0x1] + var r12 = i[01] + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + var r13 = i[-01] + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. + + var b = { + "0.1": null, + ".1": new Object(), + "1": 1, + "1.": "", + "1..": true, + "1.0": new Date(), + "-1.0": /123/, + "-1": Date + }; + + var r1 = b['0.1']; + var r2 = b['.1']; + var r3 = b['1']; + var r3 = c[1]; + var r4 = b['1.']; + var r3 = c[1.]; // same as indexing by 1 when done numerically + var r5 = b['1..']; + var r6 = b['1.0']; + var r3 = c[1.0]; // same as indexing by 1 when done numerically + // BUG 823822 + var r7 = i[-1]; + var r7 = i[-1.0]; + var r8 = i["-1.0"]; + var r9 = i["-1"]; + var r10 = i[0x1] + var r11 = i[-0x1] + var r12 = i[01] + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. + var r13 = i[-01] + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols index 2479804f7e4cd..bbb6a6cd0db26 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols @@ -115,7 +115,6 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) ->01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -233,7 +232,6 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) ->01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -347,7 +345,6 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) ->01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -461,7 +458,6 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) ->01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt b/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt deleted file mode 100644 index 14de1c76f690e..0000000000000 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).errors.txt +++ /dev/null @@ -1,451 +0,0 @@ -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 deleted file mode 100644 index b00260f6ee8fb..0000000000000 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).js +++ /dev/null @@ -1,240 +0,0 @@ -//// [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 deleted file mode 100644 index 0ba13e38f29d7..0000000000000 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).symbols +++ /dev/null @@ -1,123 +0,0 @@ -=== 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 deleted file mode 100644 index c006384485d87..0000000000000 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es3).types +++ /dev/null @@ -1,391 +0,0 @@ -=== 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 deleted file mode 100644 index 14de1c76f690e..0000000000000 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).errors.txt +++ /dev/null @@ -1,451 +0,0 @@ -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.errors.txt b/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt new file mode 100644 index 0000000000000..3037a62ac6212 --- /dev/null +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt @@ -0,0 +1,449 @@ +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(3,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(5,1): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(6,5): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(7,5): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(8,5): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(9,5): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(10,5): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(11,4): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(12,4): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(13,4): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(14,4): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(15,4): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(18,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(19,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(20,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(21,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(22,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(23,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(24,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(26,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(27,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(28,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(29,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(30,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(31,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(32,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(34,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(35,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(36,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(37,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(38,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(39,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(40,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x7f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(41,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(42,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(43,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(44,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(45,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(46,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(47,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(48,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(49,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(50,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(51,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(52,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(53,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(54,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(55,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(56,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(57,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(58,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(59,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(60,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(61,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(62,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(63,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(64,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(65,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(66,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x7f'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(67,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(68,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(69,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(70,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(71,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(72,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(73,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(74,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(75,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(76,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(77,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(78,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(79,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(80,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(81,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(82,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(83,2): error TS1485: '\8' is not allowed. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(84,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(85,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(88,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(89,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(90,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(91,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(92,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(93,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(94,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(96,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(97,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(98,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(99,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(100,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(101,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(102,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(104,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(105,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(106,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(107,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(108,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(109,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(110,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(112,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(113,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(114,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(115,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(116,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(117,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + + +==== tests/cases/compiler/octalLiteralAndEscapeSequence.ts (109 errors) ==== + 00; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + 05; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. + 000; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + 005; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. + 055; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. + `0${00}`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + `0${05}`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. + `0${000}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + `0${005}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. + `0${055}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. + `${00}0`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + `${05}0`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. + `${000}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + `${005}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. + `${055}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. + + "\0"; + "\5"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + "\00"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + "\05"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + "\55"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + "\000"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + "\005"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + "\055"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + '\0'; + '\5'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + '\00'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\05'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + '\55'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + '\000'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\005'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + '\055'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + + "\1"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\01"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\001"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\17"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. + "\017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. + "\0017"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\177"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x7f'. + "\18"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\018"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\0018"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + "\4"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + "\47"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + "\047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + "\0047"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + "\477"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + "\48"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + "\048"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + "\0048"; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + "\8"; + ~~ +!!! error TS1485: '\8' is not allowed. + "\87"; + ~~ +!!! error TS1485: '\8' is not allowed. + "\087"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + "\0087"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + "\877"; + ~~ +!!! error TS1485: '\8' is not allowed. + "\88"; + ~~ +!!! error TS1485: '\8' is not allowed. + "\088"; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + "\0088"; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\1'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\01'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\001'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\17'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. + '\017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x0f'. + '\0017'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\177'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x7f'. + '\18'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\018'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\0018'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x01'. + '\4'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + '\47'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + '\047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + '\0047'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + '\477'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x27'. + '\48'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + '\048'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + '\0048'; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x04'. + '\8'; + ~~ +!!! error TS1485: '\8' is not allowed. + '\87'; + ~~ +!!! error TS1485: '\8' is not allowed. + '\087'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\0087'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\877'; + ~~ +!!! error TS1485: '\8' is not allowed. + '\88'; + ~~ +!!! error TS1485: '\8' is not allowed. + '\088'; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + '\0088'; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + + `\0`; + `\5`; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\00`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `\05`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\55`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `\000`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `\005`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\055`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `${0}\0`; + `${0}\5`; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\00`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `${0}\05`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\55`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `${0}\000`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `${0}\005`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\055`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `\0${0}`; + `\5${0}`; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\00${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `\05${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\55${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `\000${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `\005${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `\055${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `${0}\0${0}`; + `${0}\5${0}`; + ~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\00${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `${0}\05${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\55${0}`; + ~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + `${0}\000${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. + `${0}\005${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. + `${0}\055${0}`; + ~~~~ +!!! error TS1484: Octal escape sequences are not allowed. Use the syntax '\x2d'. + \ No newline at end of file diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js b/tests/baselines/reference/octalLiteralAndEscapeSequence.js similarity index 94% rename from tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js rename to tests/baselines/reference/octalLiteralAndEscapeSequence.js index b00260f6ee8fb..a15318605089a 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).js +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.js @@ -1,6 +1,4 @@ //// [octalLiteralAndEscapeSequence.ts] -"use strict"; - 00; 05; 000; @@ -122,7 +120,6 @@ //// [octalLiteralAndEscapeSequence.js] -"use strict"; 00; 05; 000; diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols b/tests/baselines/reference/octalLiteralAndEscapeSequence.symbols similarity index 88% rename from tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols rename to tests/baselines/reference/octalLiteralAndEscapeSequence.symbols index 0ba13e38f29d7..1e8a03d317506 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).symbols +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.symbols @@ -1,7 +1,5 @@ === tests/cases/compiler/octalLiteralAndEscapeSequence.ts === -"use strict"; - 00; 05; 000; diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types b/tests/baselines/reference/octalLiteralAndEscapeSequence.types similarity index 85% rename from tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types rename to tests/baselines/reference/octalLiteralAndEscapeSequence.types index c006384485d87..32ed227ebb0e2 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence(target=es5).types +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.types @@ -1,7 +1,4 @@ === tests/cases/compiler/octalLiteralAndEscapeSequence.ts === -"use strict"; ->"use strict" : "use strict" - 00; >00 : 0 @@ -15,7 +12,7 @@ >005 : 5 055; ->055 : 55 +>055 : 45 `0${00}`; >`0${00}` : string @@ -35,7 +32,7 @@ `0${055}`; >`0${055}` : string ->055 : 55 +>055 : 45 `${00}0`; >`${00}0` : string @@ -55,7 +52,7 @@ `${055}0`; >`${055}0` : string ->055 : 55 +>055 : 45 "\0"; >"\0" : "\0" @@ -160,10 +157,10 @@ >"\0048" : "\u00048" "\8"; ->"\8" : "\0" +>"\8" : "8" "\87"; ->"\87" : "\x007" +>"\87" : "87" "\087"; >"\087" : "\x0087" @@ -172,10 +169,10 @@ >"\0087" : "\x0087" "\877"; ->"\877" : "\x0077" +>"\877" : "877" "\88"; ->"\88" : "\x008" +>"\88" : "88" "\088"; >"\088" : "\x0088" @@ -238,10 +235,10 @@ >'\0048' : "\u00048" '\8'; ->'\8' : "\0" +>'\8' : "8" '\87'; ->'\87' : "\x007" +>'\87' : "87" '\087'; >'\087' : "\x0087" @@ -250,10 +247,10 @@ >'\0087' : "\x0087" '\877'; ->'\877' : "\x0077" +>'\877' : "877" '\88'; ->'\88' : "\x008" +>'\88' : "88" '\088'; >'\088' : "\x0088" diff --git a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt index ce569787913eb..3c5bf865f8ea6 100644 --- a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt +++ b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt @@ -1,11 +1,8 @@ -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(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o3'. -==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (1 errors) ==== "use strict"; 03; ~~ -!!! 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 +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o3'. \ No newline at end of file diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index 4641e88f13774..bae49ad671ee1 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type 'bigint'. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type 'bigint'. +tests/cases/compiler/parseBigInt.ts(56,21): error TS1121: Octal literals are not allowed. Use the syntax '0o123'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. tests/cases/compiler/parseBigInt.ts(57,22): error TS1352: A bigint literal cannot use exponential notation. tests/cases/compiler/parseBigInt.ts(58,19): error TS1353: A bigint literal must be an integer. @@ -17,7 +18,7 @@ tests/cases/compiler/parseBigInt.ts(70,53): error TS2345: Argument of type '2' i tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' is not assignable to parameter of type '1n | 3n | 2n'. -==== tests/cases/compiler/parseBigInt.ts (17 errors) ==== +==== tests/cases/compiler/parseBigInt.ts (18 errors) ==== // All bases should allow "n" suffix const bin = 0b101, binBig = 0b101n; // 5, 5n const oct = 0o567, octBig = 0o567n; // 375, 375n @@ -78,6 +79,8 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i // Parsing errors // In separate blocks because they each declare an "n" variable { const legacyOct = 0123n; } + ~~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o123'. ~ !!! error TS1005: ',' expected. { const scientific = 1e2n; } diff --git a/tests/baselines/reference/parseBigInt.types b/tests/baselines/reference/parseBigInt.types index 70fd3fa3a600a..6c824e9ca3b27 100644 --- a/tests/baselines/reference/parseBigInt.types +++ b/tests/baselines/reference/parseBigInt.types @@ -174,8 +174,8 @@ const unaryPlusHex = +0x123n; // Parsing errors // In separate blocks because they each declare an "n" variable { const legacyOct = 0123n; } ->legacyOct : 123 ->0123 : 123 +>legacyOct : 83 +>0123 : 83 >n : any { const scientific = 1e2n; } diff --git a/tests/baselines/reference/parser.numericSeparators.decmialNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.decmialNegative.errors.txt index c9f5d90f09324..eaa5a299e59a6 100644 --- a/tests/baselines/reference/parser.numericSeparators.decmialNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.decmialNegative.errors.txt @@ -8,6 +8,7 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/15.ts(1,5): erro tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts(1,1): error TS1434: Unexpected keyword or identifier. tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts(1,1): error TS2304: Cannot find name '_0'. tests/cases/conformance/parser/ecmascript2021/numericSeparators/17.ts(1,6): error TS6188: Numeric separators are not allowed here. +tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts(1,2): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/19.ts(1,5): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. @@ -24,6 +25,7 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts(1,1): erro tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts(1,1): error TS2304: Cannot find name '_0'. tests/cases/conformance/parser/ecmascript2021/numericSeparators/3.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/30.ts(1,7): error TS6188: Numeric separators are not allowed here. +tests/cases/conformance/parser/ecmascript2021/numericSeparators/31.ts(1,2): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascript2021/numericSeparators/31.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/32.ts(1,5): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/33.ts(1,9): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -39,6 +41,7 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/41.ts(1,6): erro tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts(1,1): error TS1434: Unexpected keyword or identifier. tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts(1,1): error TS2304: Cannot find name '_0'. tests/cases/conformance/parser/ecmascript2021/numericSeparators/43.ts(1,7): error TS6188: Numeric separators are not allowed here. +tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts(1,2): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/45.ts(1,5): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascript2021/numericSeparators/46.ts(1,9): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -145,8 +148,10 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error ~ !!! error TS6188: Numeric separators are not allowed here. -==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts (2 errors) ==== 0__0.0e0 + ~ +!!! error TS6188: Numeric separators are not allowed here. ~ !!! error TS6189: Multiple consecutive numeric separators are not permitted. @@ -212,8 +217,10 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error ~ !!! error TS6188: Numeric separators are not allowed here. -==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/31.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/31.ts (2 errors) ==== 0__0.0e+0 + ~ +!!! error TS6188: Numeric separators are not allowed here. ~ !!! error TS6189: Multiple consecutive numeric separators are not permitted. @@ -279,8 +286,10 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error ~ !!! error TS6188: Numeric separators are not allowed here. -==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts (2 errors) ==== 0__0.0e-0 + ~ +!!! error TS6188: Numeric separators are not allowed here. ~ !!! error TS6189: Multiple consecutive numeric separators are not permitted. diff --git a/tests/baselines/reference/plainJSBinderErrors.errors.txt b/tests/baselines/reference/plainJSBinderErrors.errors.txt index 1ebfcbcec214a..c6210e5f1a244 100644 --- a/tests/baselines/reference/plainJSBinderErrors.errors.txt +++ b/tests/baselines/reference/plainJSBinderErrors.errors.txt @@ -1,24 +1,18 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(1,1): error TS2528: A module cannot have multiple default exports. tests/cases/conformance/salsa/plainJSBinderErrors.js(2,1): error TS2528: A module cannot have multiple default exports. -tests/cases/conformance/salsa/plainJSBinderErrors.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. -tests/cases/conformance/salsa/plainJSBinderErrors.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. -tests/cases/conformance/salsa/plainJSBinderErrors.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/salsa/plainJSBinderErrors.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. -tests/cases/conformance/salsa/plainJSBinderErrors.js(12,5): error TS18012: '#constructor' is a reserved word. tests/cases/conformance/salsa/plainJSBinderErrors.js(15,20): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(18,16): error TS1102: 'delete' cannot be called on an identifier in strict mode. 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(26,27): error TS1121: Octal literals are not allowed. Use the syntax '0o10'. 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. tests/cases/conformance/salsa/plainJSBinderErrors.js(39,7): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode. 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 (18 errors) ==== +==== tests/cases/conformance/salsa/plainJSBinderErrors.js (12 errors) ==== export default 12 ~~~~~~~~~~~~~~~~~ !!! error TS2528: A module cannot have multiple default exports. @@ -28,25 +22,15 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali !!! error TS2528: A module cannot have multiple default exports. !!! related TS2752 tests/cases/conformance/salsa/plainJSBinderErrors.js:1:1: The first export default is here. const await = 1 - ~~~~~ -!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. const yield = 2 - ~~~~~ -!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. async function f() { const await = 3 - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. } function* g() { const yield = 4 - ~~~~~ -!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. } class C { #constructor = 5 - ~~~~~~~~~~~~ -!!! error TS18012: '#constructor' is a reserved word. deleted() { function container(f) { delete f @@ -72,7 +56,7 @@ 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. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o10'. with (redundant) { ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. @@ -85,8 +69,6 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali ~~~~~ !!! error TS1344: 'A label is not allowed here. break label - ~~~~~~~~~~~ -!!! error TS1107: Jump target cannot cross function boundary. } return x } diff --git a/tests/baselines/reference/plainJSBinderErrors.types b/tests/baselines/reference/plainJSBinderErrors.types index 29c4be2c11a20..7ae226e300c93 100644 --- a/tests/baselines/reference/plainJSBinderErrors.types +++ b/tests/baselines/reference/plainJSBinderErrors.types @@ -68,11 +68,11 @@ class C { >withOctal : () => any const redundant = 010 ->redundant : 10 ->010 : 10 +>redundant : 8 +>010 : 8 with (redundant) { ->redundant : 10 +>redundant : 8 return toFixed() >toFixed() : any diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt new file mode 100644 index 0000000000000..e462eccfa68ec --- /dev/null +++ b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(6,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. + + +==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (1 errors) ==== + 0xffffffff.toString(); + 0o01234.toString(); + 0b01101101.toString(); + 1234..toString(); + 1e0.toString(); + 000.toString(); + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerES3NumericLiteral2.errors.txt b/tests/baselines/reference/scannerES3NumericLiteral2.errors.txt index 4c7345ba8566d..ad92196e5770a 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral2.errors.txt +++ b/tests/baselines/reference/scannerES3NumericLiteral2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ==== tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts (1 errors) ==== 01 ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. \ No newline at end of file +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerES3NumericLiteral3.errors.txt b/tests/baselines/reference/scannerES3NumericLiteral3.errors.txt index 51df5a9c33c3f..f5376eaf69924 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral3.errors.txt +++ b/tests/baselines/reference/scannerES3NumericLiteral3.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral3.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral3.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral3.ts (1 errors) ==== +==== tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral3.ts (2 errors) ==== 01.0 + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral2.errors.txt b/tests/baselines/reference/scannerNumericLiteral2.errors.txt index faf5429f8b754..dc82abe6ff36b 100644 --- a/tests/baselines/reference/scannerNumericLiteral2.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral2.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. +tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral2.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral2.ts (1 errors) ==== 01 ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'. \ No newline at end of file +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral3.errors.txt b/tests/baselines/reference/scannerNumericLiteral3.errors.txt index 894eb391f6043..739b02f7523a4 100644 --- a/tests/baselines/reference/scannerNumericLiteral3.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral3.errors.txt @@ -1,7 +1,10 @@ +tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (1 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (2 errors) ==== 01.0 + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral8.errors.txt b/tests/baselines/reference/scannerNumericLiteral8.errors.txt index 6545050afc263..4037f3fb9d5e5 100644 --- a/tests/baselines/reference/scannerNumericLiteral8.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral8.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral8.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o3'. +tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral8.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '-0o3'. ==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral8.ts (1 errors) ==== -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 TS1121: Octal literals are not allowed. Use the syntax '-0o3'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral9.errors.txt b/tests/baselines/reference/scannerNumericLiteral9.errors.txt index 7f53ca111d981..f3bc4af992cea 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral9.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,3): error TS1005: ';' expected. +tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,1): error TS1486: Decimals with leading zeros are not allowed. ==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (1 errors) ==== 009 - ~ -!!! error TS1005: ';' expected. \ No newline at end of file + ~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral9.js b/tests/baselines/reference/scannerNumericLiteral9.js index a391606ecdf91..bf650744ecfdc 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.js +++ b/tests/baselines/reference/scannerNumericLiteral9.js @@ -2,5 +2,4 @@ 009 //// [scannerNumericLiteral9.js] -00; -9; +009; diff --git a/tests/baselines/reference/scannerNumericLiteral9.types b/tests/baselines/reference/scannerNumericLiteral9.types index f204fa0977fc2..95bb891139f0b 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.types +++ b/tests/baselines/reference/scannerNumericLiteral9.types @@ -1,5 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts === 009 ->00 : 0 ->9 : 9 +>009 : 9 diff --git a/tests/baselines/reference/strictModeOctalLiterals.errors.txt b/tests/baselines/reference/strictModeOctalLiterals.errors.txt index 9ab0bb3543991..a9c965b984a0d 100644 --- a/tests/baselines/reference/strictModeOctalLiterals.errors.txt +++ b/tests/baselines/reference/strictModeOctalLiterals.errors.txt @@ -1,26 +1,17 @@ -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(2,14): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,16): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts(4,21): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. -==== tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts (6 errors) ==== +==== tests/cases/conformance/expressions/literals/strictModeOctalLiterals.ts (3 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. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. } 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. Use the syntax '0o1'. ~~ -!!! error TS1121: Octal literals are not allowed in strict mode. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js b/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js deleted file mode 100644 index 31718d00f3aeb..0000000000000 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).js +++ /dev/null @@ -1,312 +0,0 @@ -//// [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).errors.txt b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt deleted file mode 100644 index 913375feb53c7..0000000000000 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).errors.txt +++ /dev/null @@ -1,255 +0,0 @@ -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).symbols b/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols deleted file mode 100644 index 0f9594827f459..0000000000000 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).symbols +++ /dev/null @@ -1,374 +0,0 @@ -=== 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 deleted file mode 100644 index 99f8e0c9ddec4..0000000000000 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).types +++ /dev/null @@ -1,791 +0,0 @@ -=== 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=es3).errors.txt b/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt similarity index 56% rename from tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt rename to tests/baselines/reference/templateLiteralEscapeSequence.errors.txt index 913375feb53c7..8937bb38079be 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).errors.txt +++ b/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt @@ -1,42 +1,50 @@ -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(3,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(4,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(5,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(6,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(8,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(9,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(10,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(11,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(13,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(14,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(15,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(16,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(18,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(19,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(20,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(21,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(23,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(24,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(25,6): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(26,7): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(28,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(29,11): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(30,4): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(31,5): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(33,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(34,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(35,10): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(36,11): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(38,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(39,15): error TS1198: An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive. +tests/cases/compiler/templateLiteralEscapeSequence.ts(40,8): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(41,9): error TS1125: Hexadecimal digit expected. +tests/cases/compiler/templateLiteralEscapeSequence.ts(85,8): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(86,8): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(87,8): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(88,8): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(89,8): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(90,7): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(91,7): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(92,7): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(93,7): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(94,7): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. -==== tests/cases/compiler/templateLiteralEscapeSequence.ts (32 errors) ==== +==== tests/cases/compiler/templateLiteralEscapeSequence.ts (42 errors) ==== declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; - "use strict"; - `\u`; !!! error TS1125: Hexadecimal digit expected. @@ -184,15 +192,35 @@ tests/cases/compiler/templateLiteralEscapeSequence.ts(43,9): error TS1125: Hexad tag`${0}\x00${0}`; tag`0${00}`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tag`0${05}`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`0${000}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. tag`0${005}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. tag`0${055}`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tag`${00}0`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tag`${05}0`; + ~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`${000}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. tag`${005}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. tag`${055}0`; + ~~~ +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tag`\0`; tag`\5`; tag`\00`; diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js b/tests/baselines/reference/templateLiteralEscapeSequence.js similarity index 98% rename from tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js rename to tests/baselines/reference/templateLiteralEscapeSequence.js index 31718d00f3aeb..c65717deb91d9 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es5).js +++ b/tests/baselines/reference/templateLiteralEscapeSequence.js @@ -1,8 +1,6 @@ //// [templateLiteralEscapeSequence.ts] declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; -"use strict"; - `\u`; `\u0`; `\u00`; @@ -161,7 +159,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; -"use strict"; "\\u"; "\\u0"; "\\u00"; diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols b/tests/baselines/reference/templateLiteralEscapeSequence.symbols similarity index 96% rename from tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols rename to tests/baselines/reference/templateLiteralEscapeSequence.symbols index 0f9594827f459..a6b4020a9b3ae 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).symbols +++ b/tests/baselines/reference/templateLiteralEscapeSequence.symbols @@ -5,8 +5,6 @@ declare function tag(template: TemplateStringsArray, ...substitutions: any[]): s >TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) >substitutions : Symbol(substitutions, Decl(templateLiteralEscapeSequence.ts, 0, 52)) -"use strict"; - `\u`; `\u0`; `\u00`; diff --git a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types b/tests/baselines/reference/templateLiteralEscapeSequence.types similarity index 91% rename from tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types rename to tests/baselines/reference/templateLiteralEscapeSequence.types index 99f8e0c9ddec4..958236b577317 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence(target=es3).types +++ b/tests/baselines/reference/templateLiteralEscapeSequence.types @@ -4,9 +4,6 @@ declare function tag(template: TemplateStringsArray, ...substitutions: any[]): s >template : TemplateStringsArray >substitutions : any[] -"use strict"; ->"use strict" : "use strict" - `\u`; >`\u` : "\\u" @@ -435,7 +432,7 @@ tag`0${055}`; >tag`0${055}` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string >`0${055}` : string ->055 : 55 +>055 : 45 tag`${00}0`; >tag`${00}0` : string @@ -465,7 +462,7 @@ tag`${055}0`; >tag`${055}0` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string >`${055}0` : string ->055 : 55 +>055 : 45 tag`\0`; >tag`\0` : string @@ -475,37 +472,37 @@ tag`\0`; tag`\5`; >tag`\5` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\5` : "\u0005" +>`\5` : "\\5" tag`\00`; >tag`\00` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\00` : "\0" +>`\00` : "\\00" tag`\05`; >tag`\05` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\05` : "\u0005" +>`\05` : "\\05" tag`\55`; >tag`\55` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\55` : "-" +>`\55` : "\\55" tag`\000`; >tag`\000` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\000` : "\0" +>`\000` : "\\000" tag`\005`; >tag`\005` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\005` : "\u0005" +>`\005` : "\\005" tag`\055`; >tag`\055` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\055` : "-" +>`\055` : "\\055" tag`${0}\0`; >tag`${0}\0` : string @@ -662,130 +659,130 @@ tag`${0}\055${0}`; tag`\1`; >tag`\1` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\1` : "\u0001" +>`\1` : "\\1" tag`\01`; >tag`\01` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\01` : "\u0001" +>`\01` : "\\01" tag`\001`; >tag`\001` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\001` : "\u0001" +>`\001` : "\\001" tag`\17`; >tag`\17` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\17` : "\u000F" +>`\17` : "\\17" tag`\017`; >tag`\017` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\017` : "\u000F" +>`\017` : "\\017" tag`\0017`; >tag`\0017` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0017` : "\u00017" +>`\0017` : "\\0017" tag`\177`; >tag`\177` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\177` : "" +>`\177` : "\\177" tag`\18`; >tag`\18` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\18` : "\u00018" +>`\18` : "\\18" tag`\018`; >tag`\018` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\018` : "\u00018" +>`\018` : "\\018" tag`\0018`; >tag`\0018` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0018` : "\u00018" +>`\0018` : "\\0018" tag`\4`; >tag`\4` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\4` : "\u0004" +>`\4` : "\\4" tag`\47`; >tag`\47` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\47` : "'" +>`\47` : "\\47" tag`\047`; >tag`\047` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\047` : "'" +>`\047` : "\\047" tag`\0047`; >tag`\0047` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0047` : "\u00047" +>`\0047` : "\\0047" tag`\477`; >tag`\477` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\477` : "'7" +>`\477` : "\\477" tag`\48`; >tag`\48` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\48` : "\u00048" +>`\48` : "\\48" tag`\048`; >tag`\048` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\048` : "\u00048" +>`\048` : "\\048" tag`\0048`; >tag`\0048` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0048` : "\u00048" +>`\0048` : "\\0048" tag`\8`; >tag`\8` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\8` : "\0" +>`\8` : "\\8" tag`\87`; >tag`\87` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\87` : "\x007" +>`\87` : "\\87" tag`\087`; >tag`\087` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\087` : "\x0087" +>`\087` : "\\087" tag`\0087`; >tag`\0087` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0087` : "\x0087" +>`\0087` : "\\0087" tag`\877`; >tag`\877` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\877` : "\x0077" +>`\877` : "\\877" tag`\88`; >tag`\88` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\88` : "\x008" +>`\88` : "\\88" tag`\088`; >tag`\088` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\088` : "\x0088" +>`\088` : "\\088" tag`\0088`; >tag`\0088` : string >tag : (template: TemplateStringsArray, ...substitutions: any[]) => string ->`\0088` : "\x0088" +>`\0088` : "\\0088" 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 63e158198c903..d0e8bdd2e113f 100644 --- a/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js +++ b/tests/baselines/reference/tsserver/plugins/getSupportedCodeFixes-can-be-proxied.js @@ -457,7 +457,6 @@ Info 32 [00:01:13.000] response: "1071", "1079", "1084", - "1085", "1089", "1090", "1091", @@ -712,6 +711,7 @@ Info 32 [00:01:13.000] response: "1479", "1484", "1485", + "1486", "2200", "2201", "2202", @@ -1389,8 +1389,6 @@ Info 32 [00:01:13.000] response: "8012", "8013", "8016", - "8017", - "8018", "8021", "8022", "8023", @@ -1785,7 +1783,6 @@ Info 38 [00:01:19.000] response: "1071", "1079", "1084", - "1085", "1089", "1090", "1091", @@ -2040,6 +2037,7 @@ Info 38 [00:01:19.000] response: "1479", "1484", "1485", + "1486", "2200", "2201", "2202", @@ -2717,8 +2715,6 @@ Info 38 [00:01:19.000] response: "8012", "8013", "8016", - "8017", - "8018", "8021", "8022", "8023", @@ -3025,7 +3021,6 @@ Info 40 [00:01:21.000] response: "1071", "1079", "1084", - "1085", "1089", "1090", "1091", @@ -3280,6 +3275,7 @@ Info 40 [00:01:21.000] response: "1479", "1484", "1485", + "1486", "2200", "2201", "2202", @@ -3957,8 +3953,6 @@ Info 40 [00:01:21.000] response: "8012", "8013", "8016", - "8017", - "8018", "8021", "8022", "8023", diff --git a/tests/cases/compiler/numberLiteralsWithLeadingZeros.ts b/tests/cases/compiler/numberLiteralsWithLeadingZeros.ts new file mode 100644 index 0000000000000..565bfd9a04e85 --- /dev/null +++ b/tests/cases/compiler/numberLiteralsWithLeadingZeros.ts @@ -0,0 +1,78 @@ +00; +000; +01; +001; +08; +008; + +00.5; +000.5; +01.5; +001.5; +08.5; +008.5; + +00e5; +000e5; +01e5; +001e5; +08e5; +008e5; + +00.5e5; +000.5e5; +01.5e5; +001.5e5; +08.5e5; +008.5e5; + +00.5_5; +000.5_5; +01.5_5; +001.5_5; +08.5_5; +008.5_5; + +00e5_5; +000e5_5; +01e5_5; +001e5_5; +08e5_5; +008e5_5; + +00.5_5e5_5; +000.5_5e5_5; +01.5_5e5_5; +001.5_5e5_5; +08.5_5e5_5; +008.5_5e5_5; + +0_0.5_5; +0_00.5_5; +0_0_0.5_5; +0_1.5_5; +0_01.5_5; +0_0_1.5_5; +0_8.5_5; +0_08.5_5; +0_0_8.5_5; + +0_0e5_5; +0_00e5_5; +0_0_0e5_5; +0_1e5_5; +0_01e5_5; +0_0_1e5_5; +0_8e5_5; +0_08e5_5; +0_0_8e5_5; + +0_0.5_5e5_5; +0_00.5_5e5_5; +0_0_0.5_5e5_5; +0_1.5_5e5_5; +0_01.5_5e5_5; +0_0_1.5_5e5_5; +0_8.5_5e5_5; +0_08.5_5e5_5; +0_0_8.5_5e5_5; diff --git a/tests/cases/compiler/octalLiteralAndEscapeSequence.ts b/tests/cases/compiler/octalLiteralAndEscapeSequence.ts index b7f939c030cdc..7236b52317757 100644 --- a/tests/cases/compiler/octalLiteralAndEscapeSequence.ts +++ b/tests/cases/compiler/octalLiteralAndEscapeSequence.ts @@ -1,7 +1,3 @@ -// @target: es3, es5 - -"use strict"; - 00; 05; 000; diff --git a/tests/cases/compiler/templateLiteralEscapeSequence.ts b/tests/cases/compiler/templateLiteralEscapeSequence.ts index c268074d659ae..73cc9868e2bfc 100644 --- a/tests/cases/compiler/templateLiteralEscapeSequence.ts +++ b/tests/cases/compiler/templateLiteralEscapeSequence.ts @@ -1,9 +1,5 @@ -// @target: es3, es5 - declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string; -"use strict"; - `\u`; `\u0`; `\u00`; From 0f211b754110257c3b8c9259f4e8183372828931 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Wed, 14 Dec 2022 07:48:13 +0800 Subject: [PATCH 3/5] Bug Fix Fix Numeric Literals Emission --- src/compiler/emitter.ts | 8 +- src/compiler/parser.ts | 4 +- src/compiler/scanner.ts | 27 ++-- src/compiler/transformers/taggedTemplate.ts | 2 +- src/compiler/types.ts | 28 ++-- src/compiler/utilities.ts | 9 +- tests/baselines/reference/isLiteral1.js | 2 +- tests/baselines/reference/isLiteral2.js | 2 +- tests/baselines/reference/literals.errors.txt | 8 +- tests/baselines/reference/literals.js | 4 +- .../numberLiteralsWithLeadingZeros.errors.txt | 56 +++---- .../numberLiteralsWithLeadingZeros.js | 82 +++++------ .../reference/objectLiteralErrors.errors.txt | 139 ++++++++++++++++-- .../reference/objectLiteralErrors.js | 8 +- .../reference/objectLiteralErrors.symbols | 10 +- .../reference/objectLiteralErrors.types | 12 +- ...bjectTypeWithStringNamedNumericProperty.js | 16 +- ...TypeWithStringNamedNumericProperty.symbols | 4 + .../octalLiteralAndEscapeSequence.errors.txt | 24 +-- .../octalLiteralAndEscapeSequence.js | 30 ++-- .../reference/octalLiteralInStrictModeES3.js | 2 +- tests/baselines/reference/parseBigInt.js | 2 +- .../reference/plainJSBinderErrors.errors.txt | 25 +++- .../reference/plainJSBinderErrors.js | 4 +- .../reference/plainJSBinderErrors.symbols | 2 +- .../reference/plainJSBinderErrors.types | 4 +- .../propertyAccessNumericLiterals.errors.txt | 25 +++- .../propertyAccessNumericLiterals.js | 18 ++- .../propertyAccessNumericLiterals.symbols | 28 ++++ .../propertyAccessNumericLiterals.types | 42 ++++++ .../reference/scannerES3NumericLiteral2.js | 2 +- .../reference/scannerES3NumericLiteral3.js | 2 +- .../reference/scannerNumericLiteral2.js | 2 +- .../reference/scannerNumericLiteral3.js | 2 +- .../reference/scannerNumericLiteral8.js | 2 +- .../reference/scannerNumericLiteral9.js | 2 +- .../reference/strictModeOctalLiterals.js | 2 +- .../templateLiteralEscapeSequence.errors.txt | 16 +- .../templateLiteralEscapeSequence.js | 20 +-- .../objectLiterals/objectLiteralErrors.ts | 4 +- .../propertyAccessNumericLiterals.ts | 10 +- .../conformance/salsa/plainJSBinderErrors.ts | 2 +- 42 files changed, 476 insertions(+), 217 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index d753f1b7e4c36..d66ad3bbb5797 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -411,6 +411,7 @@ import { TemplateSpan, TextRange, ThrowStatement, + TokenFlags, tokenToString, tracing, TransformationResult, @@ -2995,9 +2996,12 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri if (isNumericLiteral(expression)) { // check if numeric literal is a decimal literal that was originally written with a dot const text = getLiteralTextOfNode(expression as LiteralExpression, /*neverAsciiEscape*/ true, /*jsxAttributeEscape*/ false); - // If he number will be printed verbatim and it doesn't already contain a dot, add one + // If the number will be printed verbatim and it doesn't already contain a dot or an exponent indicator, add one // if the expression doesn't have any comments that will be emitted. - return !expression.numericLiteralFlags && !stringContains(text, tokenToString(SyntaxKind.DotToken)!); + return !(expression.numericLiteralFlags & TokenFlags.WithSpecifier) + && !stringContains(text, tokenToString(SyntaxKind.DotToken)!) + && !stringContains(text, String.fromCharCode(CharacterCodes.E)) + && !stringContains(text, String.fromCharCode(CharacterCodes.e)); } else if (isAccessExpression(expression)) { // check if constant enum value is integer diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index e8de1c366ba20..ac4bea404c820 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3607,7 +3607,7 @@ namespace Parser { } function parseTemplateHead(isTaggedTemplate: boolean): TemplateHead { - if (!isTaggedTemplate && scanner.getTokenFlags() & TokenFlags.ContainsInvalidEscape) { + if (!isTaggedTemplate && scanner.getTokenFlags() & TokenFlags.IsInvalid) { reScanTemplateHeadOrNoSubstitutionTemplate(); } const fragment = parseLiteralLikeNode(token()); @@ -6415,7 +6415,7 @@ namespace Parser { function parsePrimaryExpression(): PrimaryExpression { switch (token()) { case SyntaxKind.NoSubstitutionTemplateLiteral: - if (scanner.getTokenFlags() & TokenFlags.ContainsInvalidEscape) { + if (scanner.getTokenFlags() & TokenFlags.IsInvalid) { reScanTemplateHeadOrNoSubstitutionTemplate(); } // falls through diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 805dd25bc9c30..0122385730e14 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1073,11 +1073,14 @@ export function createScanner(languageVersion: ScriptTarget, isPreviousTokenSeparator = true; result += text.substring(start, pos); } - else if (isPreviousTokenSeparator) { - error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); - } else { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + tokenFlags |= TokenFlags.ContainsInvalidSeparator; + if (isPreviousTokenSeparator) { + error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } } pos++; start = pos; @@ -1092,6 +1095,7 @@ export function createScanner(languageVersion: ScriptTarget, break; } if (text.charCodeAt(pos - 1) === CharacterCodes._) { + tokenFlags |= TokenFlags.ContainsInvalidSeparator; error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); } return result + text.substring(start, pos); @@ -1120,10 +1124,10 @@ export function createScanner(languageVersion: ScriptTarget, function scanNumber(): { type: SyntaxKind, value: string } { let start = pos; let mainFragment: string; - let emitLeadingZeroError = false; if (text.charCodeAt(pos) === CharacterCodes._0) { pos++; if (text.charCodeAt(pos) === CharacterCodes._) { + tokenFlags |= TokenFlags.ContainsSeparator | TokenFlags.ContainsInvalidSeparator; error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); // treat it as a normal number literal pos--; @@ -1133,8 +1137,8 @@ export function createScanner(languageVersion: ScriptTarget, else if (!scanDigits()) { // NonOctalDecimalIntegerLiteral, emit error later // Separators in decimal and exponent parts are still allowed according to the spec - emitLeadingZeroError = true; - mainFragment = tokenValue; + tokenFlags |= TokenFlags.ContainsLeadingZero; + mainFragment = "" + +tokenValue; } else if (!tokenValue) { // a single zero @@ -1142,11 +1146,12 @@ export function createScanner(languageVersion: ScriptTarget, } else { // LegacyOctalIntegerLiteral - tokenValue = "0o" + tokenValue; + tokenValue = "" + parseInt(tokenValue, 8); tokenFlags |= TokenFlags.Octal; const withMinus = token === SyntaxKind.MinusToken; + const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8); start -= +withMinus; - error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, (withMinus ? "-" : "") + tokenValue); + error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, literal); return { type: SyntaxKind.NumericLiteral, value: tokenValue }; } } @@ -1188,10 +1193,10 @@ export function createScanner(languageVersion: ScriptTarget, result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } - if (emitLeadingZeroError) { + if (tokenFlags & TokenFlags.ContainsLeadingZero) { error(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start, end - start); // if a literal has a leading zero, it must not be bigint - return { type: SyntaxKind.NumericLiteral, value: result }; + return { type: SyntaxKind.NumericLiteral, value: "" + +result }; } if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { diff --git a/src/compiler/transformers/taggedTemplate.ts b/src/compiler/transformers/taggedTemplate.ts index c7a6e61da94da..b2e2f9298ae5d 100644 --- a/src/compiler/transformers/taggedTemplate.ts +++ b/src/compiler/transformers/taggedTemplate.ts @@ -94,7 +94,7 @@ export function processTaggedTemplateExpression( } function createTemplateCooked(template: TemplateHead | TemplateMiddle | TemplateTail | NoSubstitutionTemplateLiteral) { - return template.templateFlags! & TokenFlags.ContainsInvalidEscape ? factory.createVoidZero() : factory.createStringLiteral(template.text); + return template.templateFlags! & TokenFlags.IsInvalid ? factory.createVoidZero() : factory.createStringLiteral(template.text); } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 319a22a5748fd..1fb6ed23f6b0c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2793,28 +2793,36 @@ export const enum TokenFlags { /** @internal */ Unterminated = 1 << 2, /** @internal */ - ExtendedUnicodeEscape = 1 << 3, - Scientific = 1 << 4, // e.g. `10e2` - Octal = 1 << 5, // e.g. `0777` - HexSpecifier = 1 << 6, // e.g. `0x00000000` - BinarySpecifier = 1 << 7, // e.g. `0b0110010000000000` - OctalSpecifier = 1 << 8, // e.g. `0o777` + ExtendedUnicodeEscape = 1 << 3, // e.g. `\u{10ffff}` + Scientific = 1 << 4, // e.g. `10e2` + Octal = 1 << 5, // e.g. `0777` + HexSpecifier = 1 << 6, // e.g. `0x00000000` + BinarySpecifier = 1 << 7, // e.g. `0b0110010000000000` + OctalSpecifier = 1 << 8, // e.g. `0o777` /** @internal */ - ContainsSeparator = 1 << 9, // e.g. `0b1100_0101` + ContainsSeparator = 1 << 9, // e.g. `0b1100_0101` /** @internal */ - UnicodeEscape = 1 << 10, // e.g. `\u00a0` + UnicodeEscape = 1 << 10, // e.g. `\u00a0` /** @internal */ ContainsInvalidEscape = 1 << 11, // e.g. `\uhello` /** @internal */ - HexEscape = 1 << 12, // e.g. `\xa0` + HexEscape = 1 << 12, // e.g. `\xa0` + /** @internal */ + ContainsLeadingZero = 1 << 13, // e.g. `0888` + /** @internal */ + ContainsInvalidSeparator = 1 << 14, // e.g. `0_1` /** @internal */ BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, /** @internal */ + WithSpecifier = HexSpecifier | BinaryOrOctalSpecifier, + /** @internal */ StringLiteralFlags = HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, /** @internal */ - NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator, + NumericLiteralFlags = Scientific | Octal | ContainsLeadingZero | WithSpecifier | ContainsSeparator | ContainsInvalidSeparator, /** @internal */ TemplateLiteralLikeFlags = HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape, + /** @internal */ + IsInvalid = Octal | ContainsLeadingZero | ContainsInvalidSeparator | ContainsInvalidEscape, } export interface NumericLiteral extends LiteralExpression, Declaration { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 826f6e663b2ff..58748669dc2f6 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1331,8 +1331,13 @@ function canUseOriginalText(node: LiteralLikeNode, flags: GetLiteralTextFlags): return false; } - if (isNumericLiteral(node) && node.numericLiteralFlags & TokenFlags.ContainsSeparator) { - return !!(flags & GetLiteralTextFlags.AllowNumericSeparator); + if (isNumericLiteral(node)) { + if (node.numericLiteralFlags & TokenFlags.IsInvalid) { + return false; + } + if (node.numericLiteralFlags & TokenFlags.ContainsSeparator) { + return !!(flags & GetLiteralTextFlags.AllowNumericSeparator); + } } return !isBigIntLiteral(node); diff --git a/tests/baselines/reference/isLiteral1.js b/tests/baselines/reference/isLiteral1.js index e688eef72c3c7..6e5b6fbe77e8a 100644 --- a/tests/baselines/reference/isLiteral1.js +++ b/tests/baselines/reference/isLiteral1.js @@ -2,4 +2,4 @@ var x: number = 02343; //// [isLiteral1.js] -var x = 02343; +var x = 1251; diff --git a/tests/baselines/reference/isLiteral2.js b/tests/baselines/reference/isLiteral2.js index 3987c4e89b453..5d8aae2a8381b 100644 --- a/tests/baselines/reference/isLiteral2.js +++ b/tests/baselines/reference/isLiteral2.js @@ -2,4 +2,4 @@ var x: number = 02343 //// [isLiteral2.js] -var x = 02343; +var x = 1251; diff --git a/tests/baselines/reference/literals.errors.txt b/tests/baselines/reference/literals.errors.txt index 0d434c1fa5ead..027aca69a63c8 100644 --- a/tests/baselines/reference/literals.errors.txt +++ b/tests/baselines/reference/literals.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/expressions/literals/literals.ts(8,10): error TS18050: T tests/cases/conformance/expressions/literals/literals.ts(8,17): error TS18050: The value 'null' cannot be used here. tests/cases/conformance/expressions/literals/literals.ts(9,9): error TS18050: The value 'undefined' cannot be used here. tests/cases/conformance/expressions/literals/literals.ts(9,21): error TS18050: The value 'undefined' cannot be used here. -tests/cases/conformance/expressions/literals/literals.ts(19,9): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. -tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1121: Octal literals are not allowed. Use the syntax '-0o03'. +tests/cases/conformance/expressions/literals/literals.ts(19,9): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. +tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1121: Octal literals are not allowed. Use the syntax '-0o3'. ==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ==== @@ -35,14 +35,14 @@ tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1121: Oc var n = 1e4; var n = 001; // Error in ES5 ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. var n = 0x1; var n = -1; var n = -1.0; var n = -1e-4; var n = -003; // Error in ES5 ~~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o03'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o3'. var n = -0x1; var s: string; diff --git a/tests/baselines/reference/literals.js b/tests/baselines/reference/literals.js index 9f8d8f56be925..c5280f10f423e 100644 --- a/tests/baselines/reference/literals.js +++ b/tests/baselines/reference/literals.js @@ -54,12 +54,12 @@ var n; var n = 1; var n = 1.0; var n = 1e4; -var n = 001; // Error in ES5 +var n = 1; // Error in ES5 var n = 0x1; var n = -1; var n = -1.0; var n = -1e-4; -var n = -003; // Error in ES5 +var n = -3; // Error in ES5 var n = -0x1; var s; var s = ''; diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt b/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt index 6068c33c41348..9677a9707015b 100644 --- a/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.errors.txt @@ -1,74 +1,74 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(3,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(5,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(6,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(8,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(8,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(9,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(9,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(9,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(10,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(10,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(12,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(13,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,3): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(15,3): error TS2304: Cannot find name 'e5'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(16,4): error TS2304: Cannot find name 'e5'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,3): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(17,3): error TS2304: Cannot find name 'e5'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(18,4): error TS2304: Cannot find name 'e5'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(19,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(20,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(22,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(22,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(23,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(23,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(23,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(24,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(24,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(26,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(27,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(29,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(29,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(30,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(30,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(30,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(31,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(31,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(33,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(34,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,3): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(36,3): error TS2304: Cannot find name 'e5_5'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(37,4): error TS2304: Cannot find name 'e5_5'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,3): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(38,3): error TS2304: Cannot find name 'e5_5'. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(39,4): error TS2304: Cannot find name 'e5_5'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(40,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(41,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(43,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(43,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(44,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(44,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(44,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(45,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(45,3): error TS1005: ';' expected. -tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,1): error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,1): error TS1121: Octal literals are not allowed. Use the syntax '0o1'. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,4): error TS1005: ';' expected. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(47,1): error TS1486: Decimals with leading zeros are not allowed. tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(48,1): error TS1486: Decimals with leading zeros are not allowed. @@ -107,13 +107,13 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. 000; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. 01; ~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. 001; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. 08; ~~ !!! error TS1486: Decimals with leading zeros are not allowed. @@ -128,7 +128,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 000.5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~ !!! error TS1005: ';' expected. 01.5; @@ -138,7 +138,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 001.5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~ !!! error TS1005: ';' expected. 08.5; @@ -157,7 +157,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS2304: Cannot find name 'e5'. 000e5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~ !!! error TS1005: ';' expected. ~~ @@ -171,7 +171,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS2304: Cannot find name 'e5'. 001e5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~ !!! error TS1005: ';' expected. ~~ @@ -190,7 +190,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 000.5e5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~~~ !!! error TS1005: ';' expected. 01.5e5; @@ -200,7 +200,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 001.5e5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~~~ !!! error TS1005: ';' expected. 08.5e5; @@ -217,7 +217,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 000.5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~~~ !!! error TS1005: ';' expected. 01.5_5; @@ -227,7 +227,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 001.5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~~~ !!! error TS1005: ';' expected. 08.5_5; @@ -246,7 +246,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS2304: Cannot find name 'e5_5'. 000e5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~~~ !!! error TS1005: ';' expected. ~~~~ @@ -260,7 +260,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS2304: Cannot find name 'e5_5'. 001e5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~~~ !!! error TS1005: ';' expected. ~~~~ @@ -279,7 +279,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 000.5_5e5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. ~~~~~~~~ !!! error TS1005: ';' expected. 01.5_5e5_5; @@ -289,7 +289,7 @@ tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(78,2): error TS6188: Nume !!! error TS1005: ';' expected. 001.5_5e5_5; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o01'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'. ~~~~~~~~ !!! error TS1005: ';' expected. 08.5_5e5_5; diff --git a/tests/baselines/reference/numberLiteralsWithLeadingZeros.js b/tests/baselines/reference/numberLiteralsWithLeadingZeros.js index 967e6602bd865..8bd236ef57ec9 100644 --- a/tests/baselines/reference/numberLiteralsWithLeadingZeros.js +++ b/tests/baselines/reference/numberLiteralsWithLeadingZeros.js @@ -80,72 +80,72 @@ //// [numberLiteralsWithLeadingZeros.js] -00; -000; -01; -001; -08; -008; -00; +0; +0; +1; +1; +8; +8; +0; .5; -000; +0; .5; -01; +1; .5; -001; +1; .5; -08.5; -008.5; -00; +8.5; +8.5; +0; e5; -000; +0; e5; -01; +1; e5; -001; +1; e5; -08e5; -008e5; -00; +800000; +800000; +0; .5e5; -000; +0; .5e5; -01; +1; .5e5; -001; +1; .5e5; -08.5e5; -008.5e5; -00; +850000; +850000; +0; 0.55; -000; +0; 0.55; -01; +1; 0.55; -001; +1; 0.55; 8.55; -08.55; -00; +8.55; +0; e5_5; -000; +0; e5_5; -01; +1; e5_5; -001; +1; e5_5; -8e55; -08e55; -00; +8e+55; +8e+55; +0; 5.5e+54; -000; +0; 5.5e+54; -01; +1; 5.5e+54; -001; +1; 5.5e+54; -8.55e55; -08.55e55; +8.55e+55; +8.55e+55; 0.55; 0.55; 0.55; diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 2ad0919898813..d753695e6aa10 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -1,163 +1,266 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'e14' must be of type '{ 0: number; }', but here has type '{ 0: number; "0o00": number; }'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(2,18): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(3,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(4,18): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(5,21): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(6,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(7,18): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(8,20): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(9,20): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(10,20): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(11,21): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(13,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(14,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(15,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(16,19): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(17,23): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(18,22): error TS1117: An object literal cannot have multiple properties with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(19,25): error TS1117: An object literal cannot have multiple properties with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(22,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(23,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(24,22): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(25,25): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(26,23): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,12): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,22): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(27,22): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(28,24): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(29,24): error TS2300: Duplicate identifier '"a"'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,12): error TS2300: Duplicate identifier ''a''. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(30,24): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,13): error TS2300: Duplicate identifier '"a"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(31,25): error TS2300: Duplicate identifier ''a''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,13): error TS2300: Duplicate identifier '1.0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(32,25): error TS2300: Duplicate identifier ''1''. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS2300: Duplicate identifier '0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS2300: Duplicate identifier '0x0'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f14' must be of type '{ readonly 0: number; }', but here has type '{ 0: number; readonly "0o00": number; }'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,13): error TS2300: Duplicate identifier '0'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS2300: Duplicate identifier '0o0'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,13): error TS2300: Duplicate identifier '"100"'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,27): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,27): error TS2300: Duplicate identifier '1e2'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,13): error TS2300: Duplicate identifier '0x20'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,26): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,26): error TS2300: Duplicate identifier '3.2e1'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,13): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,46): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(42,16): error TS2380: The return type of a 'get' accessor must be assignable to its 'set' accessor type tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,22): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,16): error TS2380: The return type of a 'get' accessor must be assignable to its 'set' accessor type +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(48,7): error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(49,7): error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(50,5): error TS18016: Private identifiers are not allowed outside class bodies. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (41 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (78 errors) ==== // Multiple properties with the same name var e1 = { a: 0, a: 0 }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e2 = { a: '', a: '' }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e3 = { a: 0, a: '' }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e4 = { a: true, a: false }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e5 = { a: {}, a: {} }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e6 = { a: 0, 'a': 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e7 = { 'a': 0, a: 0 }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e8 = { 'a': 0, "a": 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e9 = { 'a': 0, 'a': 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e10 = { "a": 0, 'a': 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e11 = { 1.0: 0, '1': 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e12 = { 0: 0, 0: 0 }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e13 = { 0: 0, 0: 0 }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e14 = { 0: 0, 0x0: 0 }; - var e14 = { 0: 0, 000: 0 }; - ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'e14' must be of type '{ 0: number; }', but here has type '{ 0: number; "0o00": number; }'. -!!! related TS6203 tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts:15:5: 'e14' was also declared here. ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1117: An object literal cannot have multiple properties with the same name. + var e14 = { 0: 0, 0o0: 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e15 = { "100": 0, 1e2: 0 }; + ~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e16 = { 0x20: 0, 3.2e1: 0 }; + ~~~~~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. var e17 = { a: 0, b: 1, a: 0 }; + ~ +!!! error TS1117: An object literal cannot have multiple properties with the same name. // Accessor and property with the same name var f1 = { a: 0, get a() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f2 = { a: '', get a() { return ''; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f3 = { a: 0, get a() { return ''; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f4 = { a: true, get a() { return false; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f5 = { a: {}, get a() { return {}; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f6 = { a: 0, get 'a'() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f7 = { 'a': 0, get a() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. var f8 = { 'a': 0, get "a"() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '"a"'. var f9 = { 'a': 0, get 'a'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier ''a''. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f10 = { "a": 0, get 'a'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier '"a"'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''a''. var f11 = { 1.0: 0, get '1'() { return 0; } }; ~~~ !!! error TS2300: Duplicate identifier '1.0'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier ''1''. var f12 = { 0: 0, get 0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier '0'. var f13 = { 0: 0, get 0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier '0'. var f14 = { 0: 0, get 0x0() { return 0; } }; ~ !!! error TS2300: Duplicate identifier '0'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '0x0'. - var f14 = { 0: 0, get 000() { return 0; } }; - ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f14' must be of type '{ readonly 0: number; }', but here has type '{ 0: number; readonly "0o00": number; }'. -!!! related TS6203 tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts:35:5: 'f14' was also declared here. + var f14 = { 0: 0, get 0o0() { return 0; } }; + ~ +!!! error TS2300: Duplicate identifier '0'. + ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS2300: Duplicate identifier '0o0'. var f15 = { "100": 0, get 1e2() { return 0; } }; ~~~~~ !!! error TS2300: Duplicate identifier '"100"'. ~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~ !!! error TS2300: Duplicate identifier '1e2'. var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; ~~~~ !!! error TS2300: Duplicate identifier '0x20'. ~~~~~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~~~~~ !!! error TS2300: Duplicate identifier '3.2e1'. var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS1119: An object literal cannot have property and accessor with the same name. + ~ !!! error TS2300: Duplicate identifier 'a'. // Get and set accessor with mismatched type annotations @@ -174,7 +277,13 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,16) // did you mean colon errors var h1 = { x = 1, + ~ +!!! error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. y = 2, + ~ +!!! error TS1312: Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern. #z: 3 + ~~ +!!! error TS18016: Private identifiers are not allowed outside class bodies. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.js b/tests/baselines/reference/objectLiteralErrors.js index 576e23b0b78d0..4da3e1bd5d564 100644 --- a/tests/baselines/reference/objectLiteralErrors.js +++ b/tests/baselines/reference/objectLiteralErrors.js @@ -14,7 +14,7 @@ var e11 = { 1.0: 0, '1': 0 }; var e12 = { 0: 0, 0: 0 }; var e13 = { 0: 0, 0: 0 }; var e14 = { 0: 0, 0x0: 0 }; -var e14 = { 0: 0, 000: 0 }; +var e14 = { 0: 0, 0o0: 0 }; var e15 = { "100": 0, 1e2: 0 }; var e16 = { 0x20: 0, 3.2e1: 0 }; var e17 = { a: 0, b: 1, a: 0 }; @@ -34,7 +34,7 @@ var f11 = { 1.0: 0, get '1'() { return 0; } }; var f12 = { 0: 0, get 0() { return 0; } }; var f13 = { 0: 0, get 0() { return 0; } }; var f14 = { 0: 0, get 0x0() { return 0; } }; -var f14 = { 0: 0, get 000() { return 0; } }; +var f14 = { 0: 0, get 0o0() { return 0; } }; var f15 = { "100": 0, get 1e2() { return 0; } }; var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; @@ -68,7 +68,7 @@ var e11 = { 1.0: 0, '1': 0 }; var e12 = { 0: 0, 0: 0 }; var e13 = { 0: 0, 0: 0 }; var e14 = { 0: 0, 0x0: 0 }; -var e14 = { 0: 0, 000: 0 }; +var e14 = { 0: 0, 0: 0 }; var e15 = { "100": 0, 1e2: 0 }; var e16 = { 0x20: 0, 3.2e1: 0 }; var e17 = { a: 0, b: 1, a: 0 }; @@ -87,7 +87,7 @@ var f11 = { 1.0: 0, get '1'() { return 0; } }; var f12 = { 0: 0, get 0() { return 0; } }; var f13 = { 0: 0, get 0() { return 0; } }; var f14 = { 0: 0, get 0x0() { return 0; } }; -var f14 = { 0: 0, get 000() { return 0; } }; +var f14 = { 0: 0, get 0o0() { return 0; } }; var f15 = { "100": 0, get 1e2() { return 0; } }; var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; diff --git a/tests/baselines/reference/objectLiteralErrors.symbols b/tests/baselines/reference/objectLiteralErrors.symbols index 020fb20dbc9bf..b31666caafb91 100644 --- a/tests/baselines/reference/objectLiteralErrors.symbols +++ b/tests/baselines/reference/objectLiteralErrors.symbols @@ -70,10 +70,10 @@ var e14 = { 0: 0, 0x0: 0 }; >0 : Symbol(0, Decl(objectLiteralErrors.ts, 14, 11), Decl(objectLiteralErrors.ts, 14, 17)) >0x0 : Symbol(0, Decl(objectLiteralErrors.ts, 14, 11), Decl(objectLiteralErrors.ts, 14, 17)) -var e14 = { 0: 0, 000: 0 }; +var e14 = { 0: 0, 0o0: 0 }; >e14 : Symbol(e14, Decl(objectLiteralErrors.ts, 14, 3), Decl(objectLiteralErrors.ts, 15, 3)) ->0 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11)) ->000 : Symbol(000, Decl(objectLiteralErrors.ts, 15, 17)) +>0 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11), Decl(objectLiteralErrors.ts, 15, 17)) +>0o0 : Symbol(0, Decl(objectLiteralErrors.ts, 15, 11), Decl(objectLiteralErrors.ts, 15, 17)) var e15 = { "100": 0, 1e2: 0 }; >e15 : Symbol(e15, Decl(objectLiteralErrors.ts, 16, 3)) @@ -162,10 +162,10 @@ var f14 = { 0: 0, get 0x0() { return 0; } }; >0 : Symbol(0, Decl(objectLiteralErrors.ts, 34, 11)) >0x0 : Symbol(0x0, Decl(objectLiteralErrors.ts, 34, 17)) -var f14 = { 0: 0, get 000() { return 0; } }; +var f14 = { 0: 0, get 0o0() { return 0; } }; >f14 : Symbol(f14, Decl(objectLiteralErrors.ts, 34, 3), Decl(objectLiteralErrors.ts, 35, 3)) >0 : Symbol(0, Decl(objectLiteralErrors.ts, 35, 11)) ->000 : Symbol(000, Decl(objectLiteralErrors.ts, 35, 17)) +>0o0 : Symbol(0o0, Decl(objectLiteralErrors.ts, 35, 17)) var f15 = { "100": 0, get 1e2() { return 0; } }; >f15 : Symbol(f15, Decl(objectLiteralErrors.ts, 36, 3)) diff --git a/tests/baselines/reference/objectLiteralErrors.types b/tests/baselines/reference/objectLiteralErrors.types index 59fbc7c18af56..e3ff3cf613c5e 100644 --- a/tests/baselines/reference/objectLiteralErrors.types +++ b/tests/baselines/reference/objectLiteralErrors.types @@ -112,12 +112,12 @@ var e14 = { 0: 0, 0x0: 0 }; >0x0 : number >0 : 0 -var e14 = { 0: 0, 000: 0 }; +var e14 = { 0: 0, 0o0: 0 }; >e14 : { 0: number; } ->{ 0: 0, 000: 0 } : { 0: number; "0o00": number; } +>{ 0: 0, 0o0: 0 } : { 0: number; } >0 : number >0 : 0 ->000 : number +>0o0 : number >0 : 0 var e15 = { "100": 0, 1e2: 0 }; @@ -259,12 +259,12 @@ var f14 = { 0: 0, get 0x0() { return 0; } }; >0x0 : number >0 : 0 -var f14 = { 0: 0, get 000() { return 0; } }; +var f14 = { 0: 0, get 0o0() { return 0; } }; >f14 : { readonly 0: number; } ->{ 0: 0, get 000() { return 0; } } : { 0: number; readonly "0o00": number; } +>{ 0: 0, get 0o0() { return 0; } } : { readonly 0: number; } >0 : number >0 : 0 ->000 : number +>0o0 : number >0 : 0 var f15 = { "100": 0, get 1e2() { return 0; } }; diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js index f5ac9f9821a4b..837a57aed52c7 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js @@ -152,8 +152,8 @@ var r8 = i["-1.0"]; var r9 = i["-1"]; var r10 = i[0x1]; var r11 = i[-0x1]; -var r12 = i[01]; -var r13 = i[-01]; +var r12 = i[1]; +var r13 = i[-1]; var i; var r1 = i['0.1']; var r2 = i['.1']; @@ -171,8 +171,8 @@ var r8 = i["-1.0"]; var r9 = i["-1"]; var r10 = i[0x1]; var r11 = i[-0x1]; -var r12 = i[01]; -var r13 = i[-01]; +var r12 = i[1]; +var r13 = i[-1]; var a; var r1 = a['0.1']; var r2 = a['.1']; @@ -190,8 +190,8 @@ var r8 = i["-1.0"]; var r9 = i["-1"]; var r10 = i[0x1]; var r11 = i[-0x1]; -var r12 = i[01]; -var r13 = i[-01]; +var r12 = i[1]; +var r13 = i[-1]; var b = { "0.1": null, ".1": new Object(), @@ -218,5 +218,5 @@ var r8 = i["-1.0"]; var r9 = i["-1"]; var r10 = i[0x1]; var r11 = i[-0x1]; -var r12 = i[01]; -var r13 = i[-01]; +var r12 = i[1]; +var r13 = i[-1]; diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols index bbb6a6cd0db26..2479804f7e4cd 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols @@ -115,6 +115,7 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) +>01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -232,6 +233,7 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) +>01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -345,6 +347,7 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) +>01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) @@ -458,6 +461,7 @@ var r11 = i[-0x1] var r12 = i[01] >r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) >i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 46, 3)) +>01 : Symbol(I["1"], Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 17)) var r13 = i[-01] >r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt b/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt index 3037a62ac6212..65851a3c1d18a 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.errors.txt @@ -1,17 +1,17 @@ tests/cases/compiler/octalLiteralAndEscapeSequence.ts(1,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(2,1): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(3,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(3,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(4,1): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(5,1): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(6,5): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(7,5): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(8,5): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(9,5): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(8,5): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(9,5): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(10,5): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(11,4): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(12,4): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(13,4): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. -tests/cases/compiler/octalLiteralAndEscapeSequence.ts(14,4): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(13,4): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/octalLiteralAndEscapeSequence.ts(14,4): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(15,4): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(18,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x05'. tests/cases/compiler/octalLiteralAndEscapeSequence.ts(19,2): error TS1484: Octal escape sequences are not allowed. Use the syntax '\x00'. @@ -118,10 +118,10 @@ tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1484: Octa !!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. 000; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. 005; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. 055; ~~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. @@ -133,10 +133,10 @@ tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1484: Octa !!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. `0${000}`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. `0${005}`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. `0${055}`; ~~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. @@ -148,10 +148,10 @@ tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1484: Octa !!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. `${000}0`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. `${005}0`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. `${055}0`; ~~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence.js b/tests/baselines/reference/octalLiteralAndEscapeSequence.js index a15318605089a..9199452ff916e 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence.js +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.js @@ -120,21 +120,21 @@ //// [octalLiteralAndEscapeSequence.js] -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; +0; +5; +45; +"0".concat(0); +"0".concat(5); +"0".concat(0); +"0".concat(5); +"0".concat(45); +"".concat(0, "0"); +"".concat(5, "0"); +"".concat(0, "0"); +"".concat(5, "0"); +"".concat(45, "0"); "\0"; "\5"; "\00"; diff --git a/tests/baselines/reference/octalLiteralInStrictModeES3.js b/tests/baselines/reference/octalLiteralInStrictModeES3.js index 9519503ed360d..4c6928c7e6990 100644 --- a/tests/baselines/reference/octalLiteralInStrictModeES3.js +++ b/tests/baselines/reference/octalLiteralInStrictModeES3.js @@ -4,4 +4,4 @@ //// [octalLiteralInStrictModeES3.js] "use strict"; -03; +3; diff --git a/tests/baselines/reference/parseBigInt.js b/tests/baselines/reference/parseBigInt.js index 1ffccb11e64fe..5ed586352bd50 100644 --- a/tests/baselines/reference/parseBigInt.js +++ b/tests/baselines/reference/parseBigInt.js @@ -120,7 +120,7 @@ const unaryPlusHex = +0x123n; // Parsing errors // In separate blocks because they each declare an "n" variable { - const legacyOct = 0123, n; + const legacyOct = 83, n; } { const scientific = 1e2n; diff --git a/tests/baselines/reference/plainJSBinderErrors.errors.txt b/tests/baselines/reference/plainJSBinderErrors.errors.txt index c6210e5f1a244..e2badf9a8083b 100644 --- a/tests/baselines/reference/plainJSBinderErrors.errors.txt +++ b/tests/baselines/reference/plainJSBinderErrors.errors.txt @@ -1,18 +1,23 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(1,1): error TS2528: A module cannot have multiple default exports. tests/cases/conformance/salsa/plainJSBinderErrors.js(2,1): error TS2528: A module cannot have multiple default exports. +tests/cases/conformance/salsa/plainJSBinderErrors.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. +tests/cases/conformance/salsa/plainJSBinderErrors.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. +tests/cases/conformance/salsa/plainJSBinderErrors.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. +tests/cases/conformance/salsa/plainJSBinderErrors.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. +tests/cases/conformance/salsa/plainJSBinderErrors.js(12,5): error TS18012: '#constructor' is a reserved word. tests/cases/conformance/salsa/plainJSBinderErrors.js(15,20): error TS1102: 'delete' cannot be called on an identifier in strict mode. tests/cases/conformance/salsa/plainJSBinderErrors.js(18,16): error TS1102: 'delete' cannot be called on an identifier in strict mode. 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. Use the syntax '0o10'. 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. tests/cases/conformance/salsa/plainJSBinderErrors.js(39,7): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode. 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 (12 errors) ==== +==== tests/cases/conformance/salsa/plainJSBinderErrors.js (17 errors) ==== export default 12 ~~~~~~~~~~~~~~~~~ !!! error TS2528: A module cannot have multiple default exports. @@ -22,15 +27,25 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali !!! error TS2528: A module cannot have multiple default exports. !!! related TS2752 tests/cases/conformance/salsa/plainJSBinderErrors.js:1:1: The first export default is here. const await = 1 + ~~~~~ +!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. const yield = 2 + ~~~~~ +!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. async function f() { const await = 3 + ~~~~~ +!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. } function* g() { const yield = 4 + ~~~~~ +!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. } class C { #constructor = 5 + ~~~~~~~~~~~~ +!!! error TS18012: '#constructor' is a reserved word. deleted() { function container(f) { delete f @@ -54,9 +69,7 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali !!! 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. } withOctal() { - const redundant = 010 - ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o10'. + const redundant = 0o10 with (redundant) { ~~~~ !!! error TS1101: 'with' statements are not allowed in strict mode. @@ -69,6 +82,8 @@ tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invali ~~~~~ !!! error TS1344: 'A label is not allowed here. break label + ~~~~~~~~~~~ +!!! error TS1107: Jump target cannot cross function boundary. } return x } diff --git a/tests/baselines/reference/plainJSBinderErrors.js b/tests/baselines/reference/plainJSBinderErrors.js index 5f8f3138a64c5..e08e041127e6a 100644 --- a/tests/baselines/reference/plainJSBinderErrors.js +++ b/tests/baselines/reference/plainJSBinderErrors.js @@ -24,7 +24,7 @@ class C { const arguments = 8 } withOctal() { - const redundant = 010 + const redundant = 0o10 with (redundant) { return toFixed() } @@ -67,7 +67,7 @@ class C { const arguments = 8; } withOctal() { - const redundant = 010; + const redundant = 0o10; with (redundant) { return toFixed(); } diff --git a/tests/baselines/reference/plainJSBinderErrors.symbols b/tests/baselines/reference/plainJSBinderErrors.symbols index 55b2866141718..3e0b96dc73dc6 100644 --- a/tests/baselines/reference/plainJSBinderErrors.symbols +++ b/tests/baselines/reference/plainJSBinderErrors.symbols @@ -56,7 +56,7 @@ class C { withOctal() { >withOctal : Symbol(C.withOctal, Decl(plainJSBinderErrors.js, 23, 5)) - const redundant = 010 + const redundant = 0o10 >redundant : Symbol(redundant, Decl(plainJSBinderErrors.js, 25, 13)) with (redundant) { diff --git a/tests/baselines/reference/plainJSBinderErrors.types b/tests/baselines/reference/plainJSBinderErrors.types index 7ae226e300c93..1b704fb3aff58 100644 --- a/tests/baselines/reference/plainJSBinderErrors.types +++ b/tests/baselines/reference/plainJSBinderErrors.types @@ -67,9 +67,9 @@ class C { withOctal() { >withOctal : () => any - const redundant = 010 + const redundant = 0o10 >redundant : 8 ->010 : 8 +>0o10 : 8 with (redundant) { >redundant : 8 diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt index e462eccfa68ec..c4312ee2de48d 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt +++ b/tests/baselines/reference/propertyAccessNumericLiterals.errors.txt @@ -1,7 +1,11 @@ -tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(6,1): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(6,1): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(7,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(8,2): error TS6188: Numeric separators are not allowed here. +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(10,1): error TS1486: Decimals with leading zeros are not allowed. +tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(11,3): error TS6188: Numeric separators are not allowed here. -==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (1 errors) ==== +==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (5 errors) ==== 0xffffffff.toString(); 0o01234.toString(); 0b01101101.toString(); @@ -9,4 +13,19 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals 1e0.toString(); 000.toString(); ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. \ No newline at end of file +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. + 08.8e5.toString(); + ~~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 0_8.8e5.toString(); + ~ +!!! error TS6188: Numeric separators are not allowed here. + 8.8e5.toString(); + 088e4.toString(); + ~~~~~ +!!! error TS1486: Decimals with leading zeros are not allowed. + 88_e4.toString(); + ~ +!!! error TS6188: Numeric separators are not allowed here. + 88e4.toString(); + 8_8e4.toString(); \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.js b/tests/baselines/reference/propertyAccessNumericLiterals.js index 1a7eb6c0a2113..c5b223fa7c42e 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.js +++ b/tests/baselines/reference/propertyAccessNumericLiterals.js @@ -4,7 +4,14 @@ 0b01101101.toString(); 1234..toString(); 1e0.toString(); -000.toString(); +000.toString(); +08.8e5.toString(); +0_8.8e5.toString(); +8.8e5.toString(); +088e4.toString(); +88_e4.toString(); +88e4.toString(); +8_8e4.toString(); //// [propertyAccessNumericLiterals.js] 0xffffffff.toString(); @@ -12,4 +19,11 @@ 109..toString(); 1234..toString(); 1e0.toString(); -000.toString(); +0..toString(); +880000..toString(); +880000..toString(); +8.8e5.toString(); +880000..toString(); +880000..toString(); +88e4.toString(); +880000..toString(); diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.symbols b/tests/baselines/reference/propertyAccessNumericLiterals.symbols index 4f1d5e6fa220b..15001d9ee6269 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.symbols +++ b/tests/baselines/reference/propertyAccessNumericLiterals.symbols @@ -23,3 +23,31 @@ >000.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +08.8e5.toString(); +>08.8e5.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +0_8.8e5.toString(); +>0_8.8e5.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +8.8e5.toString(); +>8.8e5.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +088e4.toString(); +>088e4.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +88_e4.toString(); +>88_e4.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +88e4.toString(); +>88e4.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +8_8e4.toString(); +>8_8e4.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.types b/tests/baselines/reference/propertyAccessNumericLiterals.types index a2567ff253716..0fd88ed1b634b 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.types +++ b/tests/baselines/reference/propertyAccessNumericLiterals.types @@ -35,3 +35,45 @@ >000 : 0 >toString : (radix?: number) => string +08.8e5.toString(); +>08.8e5.toString() : string +>08.8e5.toString : (radix?: number) => string +>08.8e5 : 880000 +>toString : (radix?: number) => string + +0_8.8e5.toString(); +>0_8.8e5.toString() : string +>0_8.8e5.toString : (radix?: number) => string +>0_8.8e5 : 880000 +>toString : (radix?: number) => string + +8.8e5.toString(); +>8.8e5.toString() : string +>8.8e5.toString : (radix?: number) => string +>8.8e5 : 880000 +>toString : (radix?: number) => string + +088e4.toString(); +>088e4.toString() : string +>088e4.toString : (radix?: number) => string +>088e4 : 880000 +>toString : (radix?: number) => string + +88_e4.toString(); +>88_e4.toString() : string +>88_e4.toString : (radix?: number) => string +>88_e4 : 880000 +>toString : (radix?: number) => string + +88e4.toString(); +>88e4.toString() : string +>88e4.toString : (radix?: number) => string +>88e4 : 880000 +>toString : (radix?: number) => string + +8_8e4.toString(); +>8_8e4.toString() : string +>8_8e4.toString : (radix?: number) => string +>8_8e4 : 880000 +>toString : (radix?: number) => string + diff --git a/tests/baselines/reference/scannerES3NumericLiteral2.js b/tests/baselines/reference/scannerES3NumericLiteral2.js index ddb237e30062c..ca3d4084cc99c 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral2.js +++ b/tests/baselines/reference/scannerES3NumericLiteral2.js @@ -2,4 +2,4 @@ 01 //// [scannerES3NumericLiteral2.js] -01; +1; diff --git a/tests/baselines/reference/scannerES3NumericLiteral3.js b/tests/baselines/reference/scannerES3NumericLiteral3.js index 544953a1134ac..7642ec1ef0b5f 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral3.js +++ b/tests/baselines/reference/scannerES3NumericLiteral3.js @@ -2,5 +2,5 @@ 01.0 //// [scannerES3NumericLiteral3.js] -01; +1; .0; diff --git a/tests/baselines/reference/scannerNumericLiteral2.js b/tests/baselines/reference/scannerNumericLiteral2.js index 382f1e6e4dffd..cbd3445e9eb31 100644 --- a/tests/baselines/reference/scannerNumericLiteral2.js +++ b/tests/baselines/reference/scannerNumericLiteral2.js @@ -2,4 +2,4 @@ 01 //// [scannerNumericLiteral2.js] -01; +1; diff --git a/tests/baselines/reference/scannerNumericLiteral3.js b/tests/baselines/reference/scannerNumericLiteral3.js index 8e751bbd841b7..6124375ce86f1 100644 --- a/tests/baselines/reference/scannerNumericLiteral3.js +++ b/tests/baselines/reference/scannerNumericLiteral3.js @@ -2,5 +2,5 @@ 01.0 //// [scannerNumericLiteral3.js] -01; +1; .0; diff --git a/tests/baselines/reference/scannerNumericLiteral8.js b/tests/baselines/reference/scannerNumericLiteral8.js index 6d5cf860d6c5c..9b4b9ba472dba 100644 --- a/tests/baselines/reference/scannerNumericLiteral8.js +++ b/tests/baselines/reference/scannerNumericLiteral8.js @@ -2,4 +2,4 @@ -03 //// [scannerNumericLiteral8.js] --03; +-3; diff --git a/tests/baselines/reference/scannerNumericLiteral9.js b/tests/baselines/reference/scannerNumericLiteral9.js index bf650744ecfdc..42174678cb375 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.js +++ b/tests/baselines/reference/scannerNumericLiteral9.js @@ -2,4 +2,4 @@ 009 //// [scannerNumericLiteral9.js] -009; +9; diff --git a/tests/baselines/reference/strictModeOctalLiterals.js b/tests/baselines/reference/strictModeOctalLiterals.js index df3f9acfe5496..4ac5cc1767890 100644 --- a/tests/baselines/reference/strictModeOctalLiterals.js +++ b/tests/baselines/reference/strictModeOctalLiterals.js @@ -10,4 +10,4 @@ export var E; (function (E) { E[E["A"] = 13] = "A"; })(E || (E = {})); -const orbitol = 01; +const orbitol = 1; diff --git a/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt b/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt index 8937bb38079be..4cbadff3d8f36 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt +++ b/tests/baselines/reference/templateLiteralEscapeSequence.errors.txt @@ -32,13 +32,13 @@ tests/cases/compiler/templateLiteralEscapeSequence.ts(40,8): error TS1125: Hexad tests/cases/compiler/templateLiteralEscapeSequence.ts(41,9): error TS1125: Hexadecimal digit expected. tests/cases/compiler/templateLiteralEscapeSequence.ts(85,8): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/templateLiteralEscapeSequence.ts(86,8): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. -tests/cases/compiler/templateLiteralEscapeSequence.ts(87,8): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. -tests/cases/compiler/templateLiteralEscapeSequence.ts(88,8): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(87,8): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(88,8): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tests/cases/compiler/templateLiteralEscapeSequence.ts(89,8): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. tests/cases/compiler/templateLiteralEscapeSequence.ts(90,7): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tests/cases/compiler/templateLiteralEscapeSequence.ts(91,7): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. -tests/cases/compiler/templateLiteralEscapeSequence.ts(92,7): error TS1121: Octal literals are not allowed. Use the syntax '0o00'. -tests/cases/compiler/templateLiteralEscapeSequence.ts(93,7): error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(92,7): error TS1121: Octal literals are not allowed. Use the syntax '0o0'. +tests/cases/compiler/templateLiteralEscapeSequence.ts(93,7): error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tests/cases/compiler/templateLiteralEscapeSequence.ts(94,7): error TS1121: Octal literals are not allowed. Use the syntax '0o55'. @@ -199,10 +199,10 @@ tests/cases/compiler/templateLiteralEscapeSequence.ts(94,7): error TS1121: Octal !!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`0${000}`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tag`0${005}`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`0${055}`; ~~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. @@ -214,10 +214,10 @@ tests/cases/compiler/templateLiteralEscapeSequence.ts(94,7): error TS1121: Octal !!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`${000}0`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o00'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'. tag`${005}0`; ~~~ -!!! error TS1121: Octal literals are not allowed. Use the syntax '0o05'. +!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'. tag`${055}0`; ~~~ !!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'. diff --git a/tests/baselines/reference/templateLiteralEscapeSequence.js b/tests/baselines/reference/templateLiteralEscapeSequence.js index c65717deb91d9..0e4ec23f6c5cc 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence.js +++ b/tests/baselines/reference/templateLiteralEscapeSequence.js @@ -239,16 +239,16 @@ 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", ""]), 0); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 5); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 0); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 5); +tag(__makeTemplateObject(["0", ""], ["0", ""]), 45); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 0); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 5); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 0); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 5); +tag(__makeTemplateObject(["", "0"], ["", "0"]), 45); tag(__makeTemplateObject(["\0"], ["\\0"])); tag(__makeTemplateObject([void 0], ["\\5"])); tag(__makeTemplateObject([void 0], ["\\00"])); diff --git a/tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts b/tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts index b95f12b6d14cf..8e8d33e78aaf0 100644 --- a/tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts +++ b/tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts @@ -15,7 +15,7 @@ var e11 = { 1.0: 0, '1': 0 }; var e12 = { 0: 0, 0: 0 }; var e13 = { 0: 0, 0: 0 }; var e14 = { 0: 0, 0x0: 0 }; -var e14 = { 0: 0, 000: 0 }; +var e14 = { 0: 0, 0o0: 0 }; var e15 = { "100": 0, 1e2: 0 }; var e16 = { 0x20: 0, 3.2e1: 0 }; var e17 = { a: 0, b: 1, a: 0 }; @@ -35,7 +35,7 @@ var f11 = { 1.0: 0, get '1'() { return 0; } }; var f12 = { 0: 0, get 0() { return 0; } }; var f13 = { 0: 0, get 0() { return 0; } }; var f14 = { 0: 0, get 0x0() { return 0; } }; -var f14 = { 0: 0, get 000() { return 0; } }; +var f14 = { 0: 0, get 0o0() { return 0; } }; var f15 = { "100": 0, get 1e2() { return 0; } }; var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; diff --git a/tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts b/tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts index 318b05fc0b50a..11feb1932b46d 100644 --- a/tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts +++ b/tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts @@ -1,7 +1,13 @@ -// @target: es3 0xffffffff.toString(); 0o01234.toString(); 0b01101101.toString(); 1234..toString(); 1e0.toString(); -000.toString(); \ No newline at end of file +000.toString(); +08.8e5.toString(); +0_8.8e5.toString(); +8.8e5.toString(); +088e4.toString(); +88_e4.toString(); +88e4.toString(); +8_8e4.toString(); \ No newline at end of file diff --git a/tests/cases/conformance/salsa/plainJSBinderErrors.ts b/tests/cases/conformance/salsa/plainJSBinderErrors.ts index d2019e3f78b2f..7be47be3f7566 100644 --- a/tests/cases/conformance/salsa/plainJSBinderErrors.ts +++ b/tests/cases/conformance/salsa/plainJSBinderErrors.ts @@ -27,7 +27,7 @@ class C { const arguments = 8 } withOctal() { - const redundant = 010 + const redundant = 0o10 with (redundant) { return toFixed() } From 8fa60d85a86c097dbb1ddd26183cc2060d99cb74 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Tue, 24 Jan 2023 00:00:46 +0800 Subject: [PATCH 4/5] Add comment --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/scanner.ts | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5a007281a5e95..a857625c5831b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1549,7 +1549,7 @@ "category": "Error", "code": 1484 }, - "'{0}' is not allowed.": { + "Escape sequence '{0}' is not allowed.": { "category": "Error", "code": 1485 }, diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 0122385730e14..911ca7229a5e1 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1415,6 +1415,21 @@ export function createScanner(languageVersion: ScriptTarget, return resultingToken; } + // Extract from Section A.1 + // EscapeSequence :: + // | CharacterEscapeSequence + // | 0 (?![0-9]) + // | LegacyOctalEscapeSequence + // | NonOctalDecimalEscapeSequence + // | HexEscapeSequence + // | UnicodeEscapeSequence + // LegacyOctalEscapeSequence ::= + // | '0' (?=[89]) + // | [1-7] (?![0-7]) + // | [0-3] [0-7] (?![0-7]) + // | [4-7] [0-7] + // | [0-3] [0-7] [0-7] + // NonOctalDecimalEscapeSequence ::= [89] function scanEscapeSequence(shouldEmitInvalidEscapeError?: boolean): string { const start = pos; pos++; @@ -1426,8 +1441,9 @@ export function createScanner(languageVersion: ScriptTarget, pos++; switch (ch) { case CharacterCodes._0: - // '\08' is '\0' + '8' but is treated as an octal escape sequence, thus isDigit - if (!(pos < end && isDigit(text.charCodeAt(pos)))) { + // Although '0' preceding any digit is treated as LegacyOctalEscapeSequence, + // '\08' should separately be interpreted as '\0' + '8'. + if (pos >= end || !isDigit(text.charCodeAt(pos))) { return "\0"; } // '\01', '\011' @@ -1462,7 +1478,7 @@ export function createScanner(languageVersion: ScriptTarget, // the invalid '\8' and '\9' tokenFlags |= TokenFlags.ContainsInvalidEscape; if (shouldEmitInvalidEscapeError) { - error(Diagnostics._0_is_not_allowed, start, 2, text.substring(start, pos)); + error(Diagnostics.Escape_sequence_0_is_not_allowed, start, pos - start, text.substring(start, pos)); return String.fromCharCode(ch); } return text.substring(start, pos); From 251e5366a4f34b5e1498b2760e9d4a998f87109c Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Tue, 14 Mar 2023 00:51:34 +0800 Subject: [PATCH 5/5] `withMinus` refactor --- src/compiler/scanner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index d073d2cc16658..5913fd4bfb01e 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1165,7 +1165,7 @@ export function createScanner(languageVersion: ScriptTarget, tokenFlags |= TokenFlags.Octal; const withMinus = token === SyntaxKind.MinusToken; const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8); - start -= +withMinus; + if (withMinus) start--; error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, literal); return { type: SyntaxKind.NumericLiteral, value: tokenValue }; }