fix(396): (Dis)allow Octal and Bad Escape Sequences in String and (Tagged) Template Literals (#51837)

This commit is contained in:
形素叢集・ぐらふぃーむ authored and GitHub committed 2023-03-24 16:15:50 -07:00
1 parent 24373d80ec
commit c2dc2fd9b9
132 files changed
+4803 -421

No files matched your search

-10
View File
@@ -253,7 +253,6 @@ import {
nodeIsPresent,
NonNullChain,
NonNullExpression,
NumericLiteral,
objectAllocator,
ObjectLiteralExpression,
OptionalChain,
@@ -298,7 +297,6 @@ import {
TextRange,
ThisExpression,
ThrowStatement,
TokenFlags,
tokenToString,
tracing,
TracingNode,
@@ -2573,12 +2571,6 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}
}
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
@@ -2823,8 +2815,6 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
return checkStrictModeCatchClause(node as CatchClause);
case SyntaxKind.DeleteExpression:
return checkStrictModeDeleteExpression(node as DeleteExpression);
case SyntaxKind.NumericLiteral:
return checkStrictModeNumericLiteral(node as NumericLiteral);
case SyntaxKind.PostfixUnaryExpression:
return checkStrictModePostfixUnaryExpression(node as PostfixUnaryExpression);
case SyntaxKind.PrefixUnaryExpression:
+1 -27
View File
@@ -465,7 +465,6 @@ import {
isCatchClause,
isCatchClauseVariableDeclarationOrBindingElement,
isCheckJsEnabledForFile,
isChildOfNodeWithKind,
isClassDeclaration,
isClassElement,
isClassExpression,
@@ -48531,33 +48530,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;
+13 -13
View File
@@ -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
},
@@ -1597,6 +1593,18 @@
"category": "Error",
"code": 1486
},
"Octal escape sequences are not allowed. Use the syntax '{0}'.": {
"category": "Error",
"code": 1487
},
"Escape sequence '{0}' is not allowed.": {
"category": "Error",
"code": 1488
},
"Decimals with leading zeros are not allowed.": {
"category": "Error",
"code": 1489
},
"The types of '{0}' are incompatible between these types.": {
"category": "Error",
@@ -6504,14 +6512,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
+6 -2
View File
@@ -419,6 +419,7 @@ import {
TemplateSpan,
TextRange,
ThrowStatement,
TokenFlags,
tokenToString,
tracing,
TransformationResult,
@@ -3049,9 +3050,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
+10 -11
View File
@@ -2128,8 +2128,8 @@ namespace Parser {
parseErrorAt(range.pos, range.end, message, ...args);
}
function scanError(message: DiagnosticMessage, length: number): void {
parseErrorAtPosition(scanner.getTokenEnd(), length, message);
function scanError(message: DiagnosticMessage, length: number, arg0?: any): void {
parseErrorAtPosition(scanner.getTokenEnd(), length, message, arg0);
}
function getNodePos(): number {
@@ -2188,10 +2188,6 @@ namespace Parser {
return currentToken = scanner.reScanTemplateToken(isTaggedTemplate);
}
function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind {
return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate();
}
function reScanLessThanToken(): SyntaxKind {
return currentToken = scanner.reScanLessThanToken();
}
@@ -3636,8 +3632,8 @@ namespace Parser {
}
function parseTemplateHead(isTaggedTemplate: boolean): TemplateHead {
if (isTaggedTemplate) {
reScanTemplateHeadOrNoSubstitutionTemplate();
if (!isTaggedTemplate && scanner.getTokenFlags() & TokenFlags.IsInvalid) {
reScanTemplateToken(/*isTaggedTemplate*/ false);
}
const fragment = parseLiteralLikeNode(token());
Debug.assert(fragment.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind");
@@ -3660,7 +3656,6 @@ 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.
@@ -6351,7 +6346,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) {
@@ -6451,10 +6446,14 @@ namespace Parser {
function parsePrimaryExpression(): PrimaryExpression {
switch (token()) {
case SyntaxKind.NoSubstitutionTemplateLiteral:
if (scanner.getTokenFlags() & TokenFlags.IsInvalid) {
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:
-1
View File
@@ -1317,7 +1317,6 @@ export const plainJSErrors: Set<number> = 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,
+194 -88
View File
@@ -18,6 +18,7 @@ import {
LanguageVariant,
LineAndCharacter,
MapLike,
padLeft,
parsePseudoBigInt,
positionIsSynthesized,
PunctuationOrKeywordSyntaxKind,
@@ -28,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 {
@@ -71,6 +72,7 @@ export interface Scanner {
reScanSlashToken(): SyntaxKind;
reScanAsteriskEqualsToken(): SyntaxKind;
reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
/** @deprecated use {@link reScanTemplateToken}(false) */
reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
scanJsxIdentifier(): SyntaxKind;
scanJsxAttributeValue(): SyntaxKind;
@@ -1067,12 +1069,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;
}
}
@@ -1091,11 +1093,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;
@@ -1110,14 +1115,69 @@ 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);
}
// 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;
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--;
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
tokenFlags |= TokenFlags.ContainsLeadingZero;
mainFragment = "" + +tokenValue;
}
else if (!tokenValue) {
// a single zero
mainFragment = "0";
}
else {
// LegacyOctalIntegerLiteral
tokenValue = "" + parseInt(tokenValue, 8);
tokenFlags |= TokenFlags.Octal;
const withMinus = token === SyntaxKind.MinusToken;
const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8);
if (withMinus) start--;
error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, literal);
return { type: SyntaxKind.NumericLiteral, value: tokenValue };
}
}
else {
mainFragment = scanNumberFragment();
}
let decimalFragment: string | undefined;
let scientificFragment: string | undefined;
if (text.charCodeAt(pos) === CharacterCodes.dot) {
@@ -1153,6 +1213,12 @@ export function createScanner(languageVersion: ScriptTarget,
result = text.substring(start, end); // No need to use all the fragments; no _ removal needed
}
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 };
}
if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) {
checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & TokenFlags.Scientific));
return {
@@ -1190,12 +1256,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;
}
/**
@@ -1278,7 +1349,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;
}
@@ -1297,7 +1368,7 @@ 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++;
@@ -1335,7 +1406,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;
}
@@ -1364,7 +1435,22 @@ export function createScanner(languageVersion: ScriptTarget,
return resultingToken;
}
function scanEscapeSequence(isTaggedTemplate?: boolean): string {
// 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++;
if (pos >= end) {
@@ -1375,13 +1461,47 @@ export function createScanner(languageVersion: ScriptTarget,
pos++;
switch (ch) {
case CharacterCodes._0:
// '\01'
if (isTaggedTemplate && pos < end && isDigit(text.charCodeAt(pos))) {
pos++;
tokenFlags |= TokenFlags.ContainsInvalidEscape;
return text.substring(start, 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";
}
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++;
}
// '\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.ContainsInvalidEscape;
if (shouldEmitInvalidEscapeError) {
error(Diagnostics.Escape_sequence_0_is_not_allowed, start, pos - start, text.substring(start, pos));
return String.fromCharCode(ch);
}
return text.substring(start, pos);
case CharacterCodes.b:
return "\b";
case CharacterCodes.t:
@@ -1399,62 +1519,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);
}
else {
pos = savePos;
if (!isCodePoint(escapedValue)) {
tokenFlags |= TokenFlags.ContainsInvalidEscape;
if (shouldEmitInvalidEscapeError) {
error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
}
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);
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);
}
}
tokenFlags |= TokenFlags.UnicodeEscape;
return String.fromCharCode(parseInt(text.substring(start + 2, pos), 16));
case CharacterCodes.x:
if (isTaggedTemplate) {
if (!isHexDigit(text.charCodeAt(pos))) {
tokenFlags |= TokenFlags.ContainsInvalidEscape;
return text.substring(start, pos);
}
else if (!isHexDigit(text.charCodeAt(pos + 1))) {
pos++;
// '\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".
@@ -1472,18 +1600,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;
@@ -1743,7 +1859,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;
@@ -1926,15 +2042,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:
@@ -2307,14 +2414,13 @@ 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 = tokenStart;
return token = scanTemplateAndSetTokenValue(isTaggedTemplate);
return token = scanTemplateAndSetTokenValue(!isTaggedTemplate);
}
function reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind {
pos = tokenStart;
return token = scanTemplateAndSetTokenValue(/*isTaggedTemplate*/ true);
return token = scanTemplateAndSetTokenValue(/*shouldEmitInvalidEscapeError*/ true);
}
function reScanJsxToken(allowMultilineJsxText = true): JsxTokenSyntaxKind {
+2 -1
View File
@@ -18,6 +18,7 @@ import {
TemplateLiteralLikeNode,
TemplateMiddle,
TemplateTail,
TokenFlags,
TransformationContext,
visitEachChild,
visitNode,
@@ -96,7 +97,7 @@ export function processTaggedTemplateExpression(
}
function createTemplateCooked(factory: NodeFactory, template: TemplateHead | TemplateMiddle | TemplateTail | NoSubstitutionTemplateLiteral) {
return template.templateFlags ? factory.createVoidZero() : factory.createStringLiteral(template.text);
return template.templateFlags! & TokenFlags.IsInvalid ? factory.createVoidZero() : factory.createStringLiteral(template.text);
}
/**
+22 -10
View File
@@ -2790,24 +2790,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,
UnicodeEscape = 1 << 10, // e.g. `\u00a0`
/** @internal */
ContainsInvalidEscape = 1 << 11, // e.g. `\uhello`
/** @internal */
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 */
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator,
WithSpecifier = HexSpecifier | BinaryOrOctalSpecifier,
/** @internal */
TemplateLiteralLikeFlags = ContainsInvalidEscape,
StringLiteralFlags = HexEscape | UnicodeEscape | ExtendedUnicodeEscape | ContainsInvalidEscape,
/** @internal */
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 {
+7 -2
View File
@@ -1700,8 +1700,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);
+2 -1
View File
@@ -8360,7 +8360,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 {
/** @deprecated use {@link getTokenFullStart} */
getStartPos(): number;
@@ -8384,6 +8384,7 @@ declare namespace ts {
reScanSlashToken(): SyntaxKind;
reScanAsteriskEqualsToken(): SyntaxKind;
reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
/** @deprecated use {@link reScanTemplateToken}(false) */
reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
scanJsxIdentifier(): SyntaxKind;
scanJsxAttributeValue(): SyntaxKind;
+2 -1
View File
@@ -4417,7 +4417,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 {
/** @deprecated use {@link getTokenFullStart} */
getStartPos(): number;
@@ -4441,6 +4441,7 @@ declare namespace ts {
reScanSlashToken(): SyntaxKind;
reScanAsteriskEqualsToken(): SyntaxKind;
reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind;
/** @deprecated use {@link reScanTemplateToken}(false) */
reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind;
scanJsxIdentifier(): SyntaxKind;
scanJsxAttributeValue(): SyntaxKind;
@@ -1,6 +1,6 @@
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
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'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
@@ -8,8 +8,8 @@ tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(3,7): error TS8018: Octa
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'.
}
@@ -1,14 +1,14 @@
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
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'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== 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'.
@@ -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
@@ -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'.
}
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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'.
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2343'.
+1 -1
View File
@@ -2,4 +2,4 @@
var x: number = 02343;
//// [isLiteral1.js]
var x = 02343;
var x = 1251;
+1 -1
View File
@@ -1,5 +1,5 @@
=== tests/cases/compiler/isLiteral1.ts ===
var x: number = 02343;
>x : number
>02343 : 2343
>02343 : 1251
@@ -1,6 +1,9 @@
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
tests/cases/compiler/isLiteral2.ts(1,17): error TS1121: Octal literals are not allowed. Use the syntax '0o2343'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== tests/cases/compiler/isLiteral2.ts (0 errors) ====
var x: number = 02343
==== tests/cases/compiler/isLiteral2.ts (1 errors) ====
var x: number = 02343
~~~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o2343'.
+1 -1
View File
@@ -2,4 +2,4 @@
var x: number = 02343
//// [isLiteral2.js]
var x = 02343;
var x = 1251;
+1 -1
View File
@@ -1,5 +1,5 @@
=== tests/cases/compiler/isLiteral2.ts ===
var x: number = 02343
>x : number
>02343 : 2343
>02343 : 1251
@@ -10,7 +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,11): error TS1005: ',' expected.
tests/cases/compiler/d.js(2,9): error TS1489: Decimals with leading zeros are not allowed.
==== tests/cases/compiler/a.js (8 errors) ====
@@ -74,5 +74,5 @@ tests/cases/compiler/d.js(2,11): error TS1005: ',' expected.
==== tests/cases/compiler/d.js (1 errors) ====
"use strict";
var x = 009; // error
~
!!! error TS1005: ',' expected.
~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
@@ -79,6 +79,5 @@ var eval = function () {
var x = 009; // error
>x : number
>00 : 0
>9 : 9
>009 : 9
@@ -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 '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 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 '0o1'.
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 '-0o3'.
var n = -0x1;
var s: string;
+2 -2
View File
@@ -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 = '';
@@ -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 '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 '0o1'.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(5,1): error TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(6,1): error TS1489: 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 '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 '0o1'.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(11,4): error TS1005: ';' expected.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(12,1): error TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(13,1): error TS1489: 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 '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 '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 TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(20,1): error TS1489: 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 '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 '0o1'.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(25,4): error TS1005: ';' expected.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(26,1): error TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(27,1): error TS1489: 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 '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 '0o1'.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(32,4): error TS1005: ';' expected.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(33,1): error TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(34,1): error TS1489: 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 '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 '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 TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(41,1): error TS1489: 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 '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 '0o1'.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(46,4): error TS1005: ';' expected.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(47,1): error TS1489: Decimals with leading zeros are not allowed.
tests/cases/compiler/numberLiteralsWithLeadingZeros.ts(48,1): error TS1489: 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 '0o0'.
01;
~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
001;
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
08;
~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008;
~~~
!!! error TS1489: 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 '0o0'.
~~
!!! 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 '0o1'.
~~
!!! error TS1005: ';' expected.
08.5;
~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008.5;
~~~~~
!!! error TS1489: 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 '0o0'.
~~
!!! 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 '0o1'.
~~
!!! error TS1005: ';' expected.
~~
!!! error TS2304: Cannot find name 'e5'.
08e5;
~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008e5;
~~~~~
!!! error TS1489: 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 '0o0'.
~~~~
!!! 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 '0o1'.
~~~~
!!! error TS1005: ';' expected.
08.5e5;
~~~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008.5e5;
~~~~~~~
!!! error TS1489: 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 '0o0'.
~~~~
!!! 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 '0o1'.
~~~~
!!! error TS1005: ';' expected.
08.5_5;
~~~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008.5_5;
~~~~~~~
!!! error TS1489: 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 '0o0'.
~~~~
!!! 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 '0o1'.
~~~~
!!! error TS1005: ';' expected.
~~~~
!!! error TS2304: Cannot find name 'e5_5'.
08e5_5;
~~~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008e5_5;
~~~~~~~
!!! error TS1489: 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 '0o0'.
~~~~~~~~
!!! 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 '0o1'.
~~~~~~~~
!!! error TS1005: ';' expected.
08.5_5e5_5;
~~~~~~~~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
008.5_5e5_5;
~~~~~~~~~~~
!!! error TS1489: 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.
@@ -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]
0;
0;
1;
1;
8;
8;
0;
.5;
0;
.5;
1;
.5;
1;
.5;
8.5;
8.5;
0;
e5;
0;
e5;
1;
e5;
1;
e5;
800000;
800000;
0;
.5e5;
0;
.5e5;
1;
.5e5;
1;
.5e5;
850000;
850000;
0;
0.55;
0;
0.55;
1;
0.55;
1;
0.55;
8.55;
8.55;
0;
e5_5;
0;
e5_5;
1;
e5_5;
1;
e5_5;
8e+55;
8e+55;
0;
5.5e+54;
0;
5.5e+54;
1;
5.5e+54;
1;
5.5e+54;
8.55e+55;
8.55e+55;
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;
@@ -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;
@@ -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
@@ -12,7 +12,6 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(12,21)
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.
@@ -61,7 +60,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23)
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,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'.
@@ -79,7 +78,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(49,7):
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 (78 errors) ====
// Multiple properties with the same name
var e1 = { a: 0, a: 0 };
~
@@ -123,9 +122,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(50,5):
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 TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o0'.
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 };
@@ -237,13 +234,13 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(50,5):
!!! 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; } };
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 TS2300: Duplicate identifier '000'.
!!! error TS2300: Duplicate identifier '0o0'.
var f15 = { "100": 0, get 1e2() { return 0; } };
~~~~~
!!! error TS2300: Duplicate identifier '"100"'.
@@ -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; } };
@@ -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), Decl(objectLiteralErrors.ts, 15, 17))
>000 : 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))
@@ -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; }
>{ 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; } } : { readonly 0: 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; } };
@@ -1,8 +1,16 @@
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
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'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts (0 errors) ====
==== 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
@@ -36,7 +44,11 @@ error TS5107: Option 'target=ES3' is deprecated and will stop functioning in Typ
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;
@@ -67,7 +79,11 @@ error TS5107: Option 'target=ES3' is deprecated and will stop functioning in Typ
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;
@@ -97,7 +113,11 @@ error TS5107: Option 'target=ES3' is deprecated and will stop functioning in Typ
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": <void>null,
@@ -127,5 +147,9 @@ error TS5107: Option 'target=ES3' is deprecated and will stop functioning in Typ
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'.
@@ -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];
@@ -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 '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 '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 '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 TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(19,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(20,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(21,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(22,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(23,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(24,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(26,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(27,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(28,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(29,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(30,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(31,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(32,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(34,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(35,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(36,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(37,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(38,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(39,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(40,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x7f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(41,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(42,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(43,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(44,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(45,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(46,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(47,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(48,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(49,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(50,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(51,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(52,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(53,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(54,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(55,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(56,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(57,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(58,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(59,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(60,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(61,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(62,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(63,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(64,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(65,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(66,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x7f'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(67,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(68,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(69,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(70,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(71,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(72,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(73,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(74,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(75,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(76,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(77,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(78,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(79,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(80,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(81,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(82,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(83,2): error TS1488: Escape sequence '\8' is not allowed.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(84,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(85,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(88,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(89,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(90,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(91,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(92,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(93,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(94,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(96,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(97,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(98,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(99,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(100,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(101,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(102,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(104,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(105,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(106,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(107,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(108,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(109,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(110,2): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(112,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(113,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(114,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(115,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(116,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(117,6): error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
tests/cases/compiler/octalLiteralAndEscapeSequence.ts(118,6): error TS1487: 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 '0o0'.
005;
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'.
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 '0o0'.
`0${005}`;
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'.
`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 '0o0'.
`${005}0`;
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o5'.
`${055}0`;
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o55'.
"\0";
"\5";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
"\00";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
"\05";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
"\55";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
"\000";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
"\005";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
"\055";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
'\0';
'\5';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
'\00';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\05';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
'\55';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
'\000';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\005';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
'\055';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
"\1";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\01";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\001";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\17";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
"\017";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
"\0017";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\177";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x7f'.
"\18";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\018";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\0018";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
"\4";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
"\47";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
"\047";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
"\0047";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
"\477";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
"\48";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
"\048";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
"\0048";
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
"\8";
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
"\87";
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
"\087";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
"\0087";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
"\877";
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
"\88";
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
"\088";
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
"\0088";
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\1';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\01';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\001';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\17';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
'\017';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x0f'.
'\0017';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\177';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x7f'.
'\18';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\018';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\0018';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x01'.
'\4';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
'\47';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
'\047';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
'\0047';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
'\477';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x27'.
'\48';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
'\048';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
'\0048';
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x04'.
'\8';
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
'\87';
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
'\087';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\0087';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\877';
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
'\88';
~~
!!! error TS1488: Escape sequence '\8' is not allowed.
'\088';
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
'\0088';
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`\0`;
`\5`;
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\00`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`\05`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\55`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`\000`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`\005`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\055`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`${0}\0`;
`${0}\5`;
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\00`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`${0}\05`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\55`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`${0}\000`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`${0}\005`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\055`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`\0${0}`;
`\5${0}`;
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\00${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`\05${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\55${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`\000${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`\005${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`\055${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`${0}\0${0}`;
`${0}\5${0}`;
~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\00${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`${0}\05${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\55${0}`;
~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
`${0}\000${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x00'.
`${0}\005${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x05'.
`${0}\055${0}`;
~~~~
!!! error TS1487: Octal escape sequences are not allowed. Use the syntax '\x2d'.
@@ -0,0 +1,237 @@
//// [octalLiteralAndEscapeSequence.ts]
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]
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";
"\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);
@@ -0,0 +1,121 @@
=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts ===
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}`;
@@ -0,0 +1,388 @@
=== tests/cases/compiler/octalLiteralAndEscapeSequence.ts ===
00;
>00 : 0
05;
>05 : 5
000;
>000 : 0
005;
>005 : 5
055;
>055 : 45
`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 : 45
`${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 : 45
"\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" : "8"
"\87";
>"\87" : "87"
"\087";
>"\087" : "\x0087"
"\0087";
>"\0087" : "\x0087"
"\877";
>"\877" : "877"
"\88";
>"\88" : "88"
"\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' : "8"
'\87';
>'\87' : "87"
'\087';
>'\087' : "\x0087"
'\0087';
>'\0087' : "\x0087"
'\877';
>'\877' : "877"
'\88';
>'\88' : "88"
'\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
@@ -1,8 +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. Use the syntax '0o3'.
==== 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. Use the syntax '0o3'.
@@ -4,4 +4,4 @@
//// [octalLiteralInStrictModeES3.js]
"use strict";
03;
3;
@@ -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; }
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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; }
@@ -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.
@@ -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;
@@ -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
@@ -69,7 +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
const redundant = 0o10
with (redundant) {
~~~~
!!! error TS1101: 'with' statements are not allowed in strict mode.
@@ -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();
}
@@ -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) {
@@ -67,12 +67,12 @@ class C {
withOctal() {
>withOctal : () => any
const redundant = 010
>redundant : 10
>010 : 10
const redundant = 0o10
>redundant : 8
>0o10 : 8
with (redundant) {
>redundant : 10
>redundant : 8
return toFixed()
>toFixed() : any
@@ -1,11 +1,31 @@
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
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 TS1489: 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 TS1489: Decimals with leading zeros are not allowed.
tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts(11,3): error TS6188: Numeric separators are not allowed here.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (0 errors) ====
==== tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts (5 errors) ====
0xffffffff.toString();
0o01234.toString();
0b01101101.toString();
1234..toString();
1e0.toString();
000.toString();
000.toString();
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o0'.
08.8e5.toString();
~~~~~~
!!! error TS1489: 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 TS1489: Decimals with leading zeros are not allowed.
88_e4.toString();
~
!!! error TS6188: Numeric separators are not allowed here.
88e4.toString();
8_8e4.toString();
@@ -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();
@@ -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, --, --))
@@ -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
@@ -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'.
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
@@ -2,4 +2,4 @@
01
//// [scannerES3NumericLiteral2.js]
01;
1;
@@ -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.
@@ -2,5 +2,5 @@
01.0
//// [scannerES3NumericLiteral3.js]
01;
1;
.0;
@@ -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'.
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
@@ -2,4 +2,4 @@
01
//// [scannerNumericLiteral2.js]
01;
1;
@@ -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.
@@ -2,5 +2,5 @@
01.0
//// [scannerNumericLiteral3.js]
01;
1;
.0;
@@ -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'.
!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o3'.
@@ -2,4 +2,4 @@
-03
//// [scannerNumericLiteral8.js]
-03;
-3;
@@ -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 TS1489: Decimals with leading zeros are not allowed.
==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (1 errors) ====
009
~
!!! error TS1005: ';' expected.
~~~
!!! error TS1489: Decimals with leading zeros are not allowed.
@@ -2,5 +2,4 @@
009
//// [scannerNumericLiteral9.js]
00;
9;
@@ -1,5 +1,4 @@
=== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts ===
009
>00 : 0
>9 : 9
>009 : 9
@@ -12,6 +12,6 @@
//CHECK#
"\u000G"
>"\u000G" : "G"
>"\u000G" : "\\u000G"
@@ -1,17 +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(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,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(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 (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. 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. Use the syntax '0o1'.
~~
!!! 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'.
@@ -10,4 +10,4 @@ export var E;
(function (E) {
E[E["A"] = 13] = "A";
})(E || (E = {}));
const orbitol = 01;
const orbitol = 1;
@@ -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 = "
@@ -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");
@@ -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 ");
@@ -0,0 +1,283 @@
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 '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 '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'.
==== tests/cases/compiler/templateLiteralEscapeSequence.ts (42 errors) ====
declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string;
`\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}`;
~~
!!! 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 '0o0'.
tag`0${005}`;
~~~
!!! 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'.
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 '0o0'.
tag`${005}0`;
~~~
!!! 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'.
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`;
@@ -0,0 +1,309 @@
//// [templateLiteralEscapeSequence.ts]
declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string;
`\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;
};
"\\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", ""]), 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"]));
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"]));
@@ -0,0 +1,372 @@
=== 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))
`\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))
@@ -0,0 +1,788 @@
=== tests/cases/compiler/templateLiteralEscapeSequence.ts ===
declare function tag(template: TemplateStringsArray, ...substitutions: any[]): string;
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>template : TemplateStringsArray
>substitutions : any[]
`\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 : 45
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 : 45
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` : "\\5"
tag`\00`;
>tag`\00` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\00` : "\\00"
tag`\05`;
>tag`\05` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\05` : "\\05"
tag`\55`;
>tag`\55` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\55` : "\\55"
tag`\000`;
>tag`\000` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\000` : "\\000"
tag`\005`;
>tag`\005` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\005` : "\\005"
tag`\055`;
>tag`\055` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\055` : "\\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` : "\\1"
tag`\01`;
>tag`\01` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\01` : "\\01"
tag`\001`;
>tag`\001` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\001` : "\\001"
tag`\17`;
>tag`\17` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\17` : "\\17"
tag`\017`;
>tag`\017` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\017` : "\\017"
tag`\0017`;
>tag`\0017` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0017` : "\\0017"
tag`\177`;
>tag`\177` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\177` : "\\177"
tag`\18`;
>tag`\18` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\18` : "\\18"
tag`\018`;
>tag`\018` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\018` : "\\018"
tag`\0018`;
>tag`\0018` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0018` : "\\0018"
tag`\4`;
>tag`\4` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\4` : "\\4"
tag`\47`;
>tag`\47` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\47` : "\\47"
tag`\047`;
>tag`\047` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\047` : "\\047"
tag`\0047`;
>tag`\0047` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0047` : "\\0047"
tag`\477`;
>tag`\477` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\477` : "\\477"
tag`\48`;
>tag`\48` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\48` : "\\48"
tag`\048`;
>tag`\048` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\048` : "\\048"
tag`\0048`;
>tag`\0048` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0048` : "\\0048"
tag`\8`;
>tag`\8` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\8` : "\\8"
tag`\87`;
>tag`\87` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\87` : "\\87"
tag`\087`;
>tag`\087` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\087` : "\\087"
tag`\0087`;
>tag`\0087` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0087` : "\\0087"
tag`\877`;
>tag`\877` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\877` : "\\877"
tag`\88`;
>tag`\88` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\88` : "\\88"
tag`\088`;
>tag`\088` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\088` : "\\088"
tag`\0088`;
>tag`\0088` : string
>tag : (template: TemplateStringsArray, ...substitutions: any[]) => string
>`\0088` : "\\0088"
@@ -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}";
@@ -3,5 +3,5 @@
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = "\u{110000}";
>x : string
>"\u{110000}" : ""
>"\u{110000}" : "\\u{110000}"
@@ -3,5 +3,5 @@
// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.
var x = "\u{110000}";
>x : string
>"\u{110000}" : ""
>"\u{110000}" : "\\u{110000}"
@@ -3,4 +3,4 @@ var x = "\u{FFFFFFFF}";
//// [unicodeExtendedEscapesInStrings12_ES5.js]
var x = "";
var x = "\u{FFFFFFFF}";
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES5.ts ===
var x = "\u{FFFFFFFF}";
>x : string
>"\u{FFFFFFFF}" : ""
>"\u{FFFFFFFF}" : "\\u{FFFFFFFF}"
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings12_ES6.ts ===
var x = "\u{FFFFFFFF}";
>x : string
>"\u{FFFFFFFF}" : ""
>"\u{FFFFFFFF}" : "\\u{FFFFFFFF}"
@@ -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}";
@@ -2,5 +2,5 @@
// Shouldn't work, negatives are not allowed.
var x = "\u{-DDDD}";
>x : string
>"\u{-DDDD}" : "-DDDD}"
>"\u{-DDDD}" : "\\u{-DDDD}"
@@ -2,5 +2,5 @@
// Shouldn't work, negatives are not allowed.
var x = "\u{-DDDD}";
>x : string
>"\u{-DDDD}" : "-DDDD}"
>"\u{-DDDD}" : "\\u{-DDDD}"
@@ -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}";
@@ -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}"
@@ -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}"
@@ -3,4 +3,4 @@ var x = "\u{}";
//// [unicodeExtendedEscapesInStrings19_ES5.js]
var x = "";
var x = "\u{}";
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings19_ES5.ts ===
var x = "\u{}";
>x : string
>"\u{}" : ""
>"\u{}" : "\\u{}"
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings19_ES6.ts ===
var x = "\u{}";
>x : string
>"\u{}" : ""
>"\u{}" : "\\u{}"
@@ -3,4 +3,4 @@ var x = "\u{";
//// [unicodeExtendedEscapesInStrings20_ES5.js]
var x = "";
var x = "\u{";
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more