diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5572560c3be..2cb6ab8f73c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2023,7 +2023,15 @@ namespace ts { } } if (!suggestion) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg!)); + if (nameArg) { + const lib = getSuggestedLibForNonExistentName(nameArg); + if (lib) { + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); + } + else { + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); + } + } } suggestionCount++; } @@ -20631,7 +20639,17 @@ namespace ts { case "WeakSet": case "Iterator": case "AsyncIterator": - return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; + case "SharedArrayBuffer": + case "Atomics": + case "AsyncIterable": + case "AsyncIterableIterator": + case "AsyncGenerator": + case "AsyncGeneratorFunction": + case "BigInt": + case "Reflect": + case "BigInt64Array": + case "BigUint64Array": + return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; default: if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; @@ -25887,7 +25905,15 @@ namespace ts { relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestedName); } else { - errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); + const missingProperty = declarationNameToString(propNode); + const container = typeToString(containingType); + const lib = getSuggestedLibForNonExistentProperty(missingProperty, containingType); + if (lib) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, lib); + } + else { + errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); + } } } } @@ -25903,6 +25929,34 @@ namespace ts { return prop !== undefined && prop.valueDeclaration && hasSyntacticModifier(prop.valueDeclaration, ModifierFlags.Static); } + function getSuggestedLibForNonExistentName(name: __String | Identifier) { + const missingName = diagnosticName(name); + const allFeatures = getScriptTargetFeatures(); + const libTargets = getOwnKeys(allFeatures); + for (const libTarget of libTargets) { + const containingTypes = getOwnKeys(allFeatures[libTarget]); + if (containingTypes !== undefined && contains(containingTypes, missingName)) { + return libTarget; + } + } + } + + function getSuggestedLibForNonExistentProperty(missingProperty: string, containingType: Type) { + const container = getApparentType(containingType).symbol; + if (!container) { + return undefined; + } + const allFeatures = getScriptTargetFeatures(); + const libTargets = getOwnKeys(allFeatures); + for (const libTarget of libTargets) { + const featuresOfLib = allFeatures[libTarget]; + const featuresOfContainingType = featuresOfLib[symbolName(container)]; + if (featuresOfContainingType !== undefined && contains(featuresOfContainingType, missingProperty)) { + return libTarget; + } + } + } + function getSuggestedSymbolForNonexistentProperty(name: Identifier | PrivateIdentifier | string, containingType: Type): Symbol | undefined { return getSpellingSuggestionForName(isString(name) ? name : idText(name), getPropertiesOfType(containingType), SymbolFlags.Value); } @@ -25992,6 +26046,7 @@ namespace ts { */ function getSpellingSuggestionForName(name: string, symbols: Symbol[], meaning: SymbolFlags): Symbol | undefined { return getSpellingSuggestion(name, symbols, getCandidateName); + function getCandidateName(candidate: Symbol) { const candidateName = symbolName(candidate); if (startsWith(candidateName, "\"")) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index add0104a7d0..fa6ab53f325 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2197,6 +2197,10 @@ "category": "Error", "code": 2549 }, + "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.": { + "category": "Error", + "code": 2550 + }, "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?": { "category": "Error", "code": 2551 @@ -2313,7 +2317,7 @@ "category": "Error", "code": 2582 }, - "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.": { + "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.": { "category": "Error", "code": 2583 }, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 95f81b987aa..e56356afbce 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -540,6 +540,76 @@ namespace ts { return emitNode && emitNode.flags || 0; } + interface ScriptTargetFeatures { + [key: string]: { [key: string]: string[] | undefined }; + }; + + export function getScriptTargetFeatures(): ScriptTargetFeatures { + return { + es2015: { + Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], + RegExp: ["flags", "sticky", "unicode"], + Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get"," getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], + ArrayConstructor: ["from", "of"], + ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], + NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], + Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], + Map: ["entries", "keys", "values"], + Set: ["entries", "keys", "values"], + Promise: ["all", "race", "reject", "resolve"], + Symbol: ["for", "keyFor"], + WeakMap: ["entries", "keys", "values"], + WeakSet: ["entries", "keys", "values"], + Iterator: emptyArray, + AsyncIterator: emptyArray, + String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], + StringConstructor: ["fromCodePoint", "raw"] + }, + es2016: { + Array: ["includes"] + }, + es2017: { + Atomics: emptyArray, + SharedArrayBuffer: emptyArray, + String: ["padStart", "padEnd"], + ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], + DateTimeFormat: ["formatToParts"] + }, + es2018: { + Promise: ["finally"], + RegExpMatchArray: ["groups"], + RegExpExecArray: ["groups"], + RegExp: ["dotAll"], + Intl: ["PluralRules"], + AsyncIterable: emptyArray, + AsyncIterableIterator: emptyArray, + AsyncGenerator: emptyArray, + AsyncGeneratorFunction: emptyArray, + }, + es2019: { + Array: ["flat", "flatMap"], + ObjectConstructor: ["fromEntries"], + String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], + Symbol: ["description"] + }, + es2020: { + BigInt: emptyArray, + BigInt64Array: emptyArray, + BigUint64Array: emptyArray, + Promise: ["allSettled"], + SymbolConstructor: ["matchAll"], + String: ["matchAll"], + DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], + RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] + }, + esnext: { + Promise: ["any"], + String: ["replaceAll"], + NumberFormat: ["formatToParts"] + } + }; + } + export const enum GetLiteralTextFlags { None = 0, NeverAsciiEscape = 1 << 0, @@ -5733,7 +5803,6 @@ namespace ts { if (arguments.length > 2) { text = formatStringFromArgs(text, arguments, 2); } - return { messageText: text, category: message.category, diff --git a/tests/baselines/reference/bigintWithoutLib.errors.txt b/tests/baselines/reference/bigintWithoutLib.errors.txt index ac4d7a5c2bf..993607265ce 100644 --- a/tests/baselines/reference/bigintWithoutLib.errors.txt +++ b/tests/baselines/reference/bigintWithoutLib.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/bigintWithoutLib.ts(4,25): error TS2304: Cannot find name 'BigInt'. -tests/cases/compiler/bigintWithoutLib.ts(5,13): error TS2304: Cannot find name 'BigInt'. -tests/cases/compiler/bigintWithoutLib.ts(6,5): error TS2304: Cannot find name 'BigInt'. -tests/cases/compiler/bigintWithoutLib.ts(7,13): error TS2304: Cannot find name 'BigInt'. +tests/cases/compiler/bigintWithoutLib.ts(4,25): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(5,13): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(6,5): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(7,13): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2304: Cannot find name 'BigInt'. +tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(9,1): error TS2322: Type 'Object' is not assignable to type 'bigint'. tests/cases/compiler/bigintWithoutLib.ts(11,32): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/bigintWithoutLib.ts(13,38): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/bigintWithoutLib.ts(14,38): error TS2554: Expected 0 arguments, but got 2. tests/cases/compiler/bigintWithoutLib.ts(15,38): error TS2554: Expected 0 arguments, but got 2. -tests/cases/compiler/bigintWithoutLib.ts(18,18): error TS2304: Cannot find name 'BigInt64Array'. +tests/cases/compiler/bigintWithoutLib.ts(18,18): error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(18,38): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(19,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(20,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? @@ -18,34 +18,34 @@ tests/cases/compiler/bigintWithoutLib.ts(20,34): error TS2737: BigInt literals a tests/cases/compiler/bigintWithoutLib.ts(20,38): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(20,42): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(21,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? -tests/cases/compiler/bigintWithoutLib.ts(22,19): error TS2304: Cannot find name 'BigInt64Array'. -tests/cases/compiler/bigintWithoutLib.ts(23,19): error TS2304: Cannot find name 'BigInt64Array'. -tests/cases/compiler/bigintWithoutLib.ts(24,19): error TS2304: Cannot find name 'BigInt64Array'. -tests/cases/compiler/bigintWithoutLib.ts(30,19): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(30,40): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(31,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(32,20): error TS2304: Cannot find name 'BigUint64Array'. +tests/cases/compiler/bigintWithoutLib.ts(22,19): error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(23,19): error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(24,19): error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(30,19): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(30,40): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(31,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(32,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(32,36): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(32,40): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(32,44): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(33,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(34,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(35,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(36,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(43,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. +tests/cases/compiler/bigintWithoutLib.ts(33,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(34,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(35,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(36,20): error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(43,10): error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(43,26): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(44,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. +tests/cases/compiler/bigintWithoutLib.ts(44,10): error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(44,26): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(45,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(46,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. +tests/cases/compiler/bigintWithoutLib.ts(45,10): error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(46,10): error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(46,26): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(47,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. +tests/cases/compiler/bigintWithoutLib.ts(47,10): error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(47,26): error TS2737: BigInt literals are not available when targeting lower than ES2020. -tests/cases/compiler/bigintWithoutLib.ts(48,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(50,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(51,22): error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(52,22): error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. +tests/cases/compiler/bigintWithoutLib.ts(48,10): error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2550: Property 'getBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(50,22): error TS2550: Property 'getBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(51,22): error TS2550: Property 'getBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/bigintWithoutLib.ts(52,22): error TS2550: Property 'getBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. tests/cases/compiler/bigintWithoutLib.ts(55,36): error TS2345: Argument of type 'bigint' is not assignable to parameter of type 'number'. tests/cases/compiler/bigintWithoutLib.ts(55,36): error TS2737: BigInt literals are not available when targeting lower than ES2020. tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type 'bigint' is not assignable to parameter of type 'number'. @@ -57,21 +57,21 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type // Test BigInt functions let bigintVal: bigint = BigInt(123); ~~~~~~ -!!! error TS2304: Cannot find name 'BigInt'. +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = BigInt("456"); ~~~~~~ -!!! error TS2304: Cannot find name 'BigInt'. +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. new BigInt(123); ~~~~~~ -!!! error TS2304: Cannot find name 'BigInt'. +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = BigInt.asIntN(8, 0xFFFFn); ~~~~~~ -!!! error TS2304: Cannot find name 'BigInt'. +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~~~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. bigintVal = BigInt.asUintN(8, 0xFFFFn); ~~~~~~ -!!! error TS2304: Cannot find name 'BigInt'. +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~~~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. bigintVal = bigintVal.valueOf(); // should error - bigintVal inferred as {} @@ -95,7 +95,7 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type // Test BigInt64Array let bigIntArray: BigInt64Array = new BigInt64Array(); ~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigInt64Array'. +!!! error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? !!! related TS2728 tests/cases/compiler/bigintWithoutLib.ts:18:5: 'bigIntArray' is declared here. @@ -119,13 +119,13 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type !!! related TS2728 tests/cases/compiler/bigintWithoutLib.ts:18:5: 'bigIntArray' is declared here. bigIntArray = new BigInt64Array(new ArrayBuffer(80)); ~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigInt64Array'. +!!! error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); ~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigInt64Array'. +!!! error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); ~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigInt64Array'. +!!! error TS2583: Cannot find name 'BigInt64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. let len: number = bigIntArray.length; bigIntArray.length = 10; let arrayBufferLike: ArrayBufferView = bigIntArray; @@ -133,15 +133,15 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type // Test BigUint64Array let bigUintArray: BigUint64Array = new BigUint64Array(); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigUintArray = new BigUint64Array(10); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigUintArray = new BigUint64Array([1n, 2n, 3n]); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. ~~ @@ -150,16 +150,16 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. bigUintArray = new BigUint64Array([1, 2, 3]); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'BigUint64Array'. +!!! error TS2583: Cannot find name 'BigUint64Array'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. len = bigIntArray.length; bigIntArray.length = 10; arrayBufferLike = bigIntArray; @@ -168,42 +168,42 @@ tests/cases/compiler/bigintWithoutLib.ts(56,36): error TS2345: Argument of type const dataView = new DataView(new ArrayBuffer(80)); dataView.setBigInt64(1, -1n); ~~~~~~~~~~~ -!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. dataView.setBigInt64(1, -1n, true); ~~~~~~~~~~~ -!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. dataView.setBigInt64(1, -1); ~~~~~~~~~~~ -!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. dataView.setBigUint64(2, 123n); ~~~~~~~~~~~~ -!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. dataView.setBigUint64(2, 123n, true); ~~~~~~~~~~~~ -!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. ~~~~ !!! error TS2737: BigInt literals are not available when targeting lower than ES2020. dataView.setBigUint64(2, 123); ~~~~~~~~~~~~ -!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. +!!! error TS2550: Property 'setBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = dataView.getBigInt64(1); ~~~~~~~~~~~ -!!! error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. +!!! error TS2550: Property 'getBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = dataView.getBigInt64(1, true); ~~~~~~~~~~~ -!!! error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. +!!! error TS2550: Property 'getBigInt64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = dataView.getBigUint64(2); ~~~~~~~~~~~~ -!!! error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. +!!! error TS2550: Property 'getBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. bigintVal = dataView.getBigUint64(2, true); ~~~~~~~~~~~~ -!!! error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. +!!! error TS2550: Property 'getBigUint64' does not exist on type 'DataView'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. // Test Intl methods with new parameter type new Intl.NumberFormat("fr").format(3000n); diff --git a/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.errors.txt b/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.errors.txt index a99536c582b..fa566152a08 100644 --- a/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.errors.txt +++ b/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.errors.txt @@ -7,7 +7,7 @@ error TS2318: Cannot find global type 'Object'. error TS2318: Cannot find global type 'RegExp'. error TS2318: Cannot find global type 'String'. tests/cases/compiler/decoratorMetadataNoLibIsolatedModulesTypes.ts(2,6): error TS2304: Cannot find name 'Decorate'. -tests/cases/compiler/decoratorMetadataNoLibIsolatedModulesTypes.ts(3,13): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/decoratorMetadataNoLibIsolatedModulesTypes.ts(3,13): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. !!! error TS2318: Cannot find global type 'Array'. @@ -25,6 +25,6 @@ tests/cases/compiler/decoratorMetadataNoLibIsolatedModulesTypes.ts(3,13): error !!! error TS2304: Cannot find name 'Decorate'. member: Map; ~~~ -!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. } \ No newline at end of file diff --git a/tests/baselines/reference/didYouMeanSuggestionErrors.errors.txt b/tests/baselines/reference/didYouMeanSuggestionErrors.errors.txt index fe1d866bb00..a6e238103bf 100644 --- a/tests/baselines/reference/didYouMeanSuggestionErrors.errors.txt +++ b/tests/baselines/reference/didYouMeanSuggestionErrors.errors.txt @@ -9,14 +9,14 @@ tests/cases/compiler/didYouMeanSuggestionErrors.ts(10,9): error TS2584: Cannot f tests/cases/compiler/didYouMeanSuggestionErrors.ts(12,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. tests/cases/compiler/didYouMeanSuggestionErrors.ts(13,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. tests/cases/compiler/didYouMeanSuggestionErrors.ts(14,19): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(16,23): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(17,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(18,23): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(19,23): error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(16,23): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(17,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(18,23): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(19,23): error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. tests/cases/compiler/didYouMeanSuggestionErrors.ts(20,19): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. tests/cases/compiler/didYouMeanSuggestionErrors.ts(21,19): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(23,18): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. -tests/cases/compiler/didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(23,18): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. ==== tests/cases/compiler/didYouMeanSuggestionErrors.ts (19 errors) ==== @@ -59,16 +59,16 @@ tests/cases/compiler/didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot const a = new Map(); ~~~ -!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const b = new Set(); ~~~ -!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const c = new WeakMap(); ~~~~~~~ -!!! error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const d = new WeakSet(); ~~~~~~~ -!!! error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'WeakSet'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const e = Symbol(); ~~~~~~ !!! error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. @@ -78,10 +78,10 @@ tests/cases/compiler/didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot const i: Iterator = null as any; ~~~~~~~~ -!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const j: AsyncIterator = null as any; ~~~~~~~~~~~~~ -!!! error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. const k: Symbol = null as any; const l: Promise = null as any; }); diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.errors.txt b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.errors.txt new file mode 100644 index 00000000000..2dc824e64c0 --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.errors.txt @@ -0,0 +1,359 @@ +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(3,26): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(4,30): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(5,35): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(6,35): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(7,24): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(8,45): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(9,35): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(10,33): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(11,28): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(12,38): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(13,24): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(14,35): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(15,28): error TS2550: Property 'find' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(18,33): error TS2550: Property 'findIndex' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(21,28): error TS2550: Property 'fill' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(22,34): error TS2550: Property 'copyWithin' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(23,31): error TS2550: Property 'entries' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(24,28): error TS2550: Property 'keys' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(25,30): error TS2550: Property 'values' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(26,40): error TS2550: Property 'from' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(27,38): error TS2550: Property 'of' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(28,44): error TS2550: Property 'assign' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(29,59): error TS2551: Property 'getOwnPropertySymbols' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyNames'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(31,40): error TS2550: Property 'is' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(32,52): error TS2551: Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'. Did you mean 'getPrototypeOf'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(33,46): error TS2550: Property 'isFinite' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(34,47): error TS2550: Property 'isInteger' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(35,43): error TS2550: Property 'isNaN' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(36,51): error TS2550: Property 'isSafeInteger' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(37,48): error TS2550: Property 'parseFloat' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(38,46): error TS2550: Property 'parseInt' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(39,28): error TS2550: Property 'clz32' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(40,27): error TS2550: Property 'imul' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(41,27): error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(42,28): error TS2551: Property 'log10' does not exist on type 'Math'. Did you mean 'LOG10E'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(43,27): error TS2551: Property 'log2' does not exist on type 'Math'. Did you mean 'LOG2E'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(44,28): error TS2550: Property 'log1p' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(45,28): error TS2550: Property 'expm1' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(46,27): error TS2551: Property 'cosh' does not exist on type 'Math'. Did you mean 'cos'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(47,27): error TS2551: Property 'sinh' does not exist on type 'Math'. Did you mean 'sin'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(48,27): error TS2551: Property 'tanh' does not exist on type 'Math'. Did you mean 'tan'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(49,28): error TS2551: Property 'acosh' does not exist on type 'Math'. Did you mean 'acos'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(50,28): error TS2551: Property 'asinh' does not exist on type 'Math'. Did you mean 'asin'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(51,28): error TS2551: Property 'atanh' does not exist on type 'Math'. Did you mean 'atan'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(52,28): error TS2550: Property 'hypot' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(53,28): error TS2550: Property 'trunc' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(54,29): error TS2551: Property 'fround' does not exist on type 'Math'. Did you mean 'round'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(55,27): error TS2550: Property 'cbrt' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(56,16): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(57,16): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(58,24): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(59,25): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(60,28): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(61,27): error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(62,23): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(63,26): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(64,20): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(65,20): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(66,21): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(67,26): error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(68,34): error TS2550: Property 'codePointAt' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(69,31): error TS2550: Property 'includes' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(70,31): error TS2550: Property 'endsWith' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(71,32): error TS2550: Property 'normalize' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(72,29): error TS2550: Property 'repeat' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(73,33): error TS2550: Property 'startsWith' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(74,29): error TS2550: Property 'anchor' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(75,26): error TS2550: Property 'big' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(76,28): error TS2550: Property 'blink' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(77,27): error TS2550: Property 'bold' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(78,28): error TS2550: Property 'fixed' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(79,32): error TS2550: Property 'fontcolor' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(80,31): error TS2550: Property 'fontsize' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(81,30): error TS2550: Property 'italics' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(82,27): error TS2550: Property 'link' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(83,28): error TS2550: Property 'small' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(84,29): error TS2550: Property 'strike' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(85,26): error TS2550: Property 'sub' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(86,26): error TS2550: Property 'sup' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(87,51): error TS2550: Property 'fromCodePoint' does not exist on type 'StringConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(88,41): error TS2550: Property 'raw' does not exist on type 'StringConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(89,32): error TS2550: Property 'flags' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(90,33): error TS2550: Property 'sticky' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts(91,34): error TS2550: Property 'unicode' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + + +==== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts (84 errors) ==== + // es2015 + const noOp = () => {}; + const testReflectApply = Reflect.apply(noOp, this, []); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectConstruct = Reflect.construct(noOp, []); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectDefineProperty = Reflect.defineProperty({}, "", {}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectDeleteProperty = Reflect.deleteProperty({}, ""); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectGet = Reflect.get({}, ""); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectIsExtensible = Reflect.isExtensible({}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectOwnKeys = Reflect.ownKeys({}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectPreventExtensions = Reflect.preventExtensions({}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectSet = Reflect.set({}, "", 0); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayFind = [""].find((val, idx, obj) => { + ~~~~ +!!! error TS2550: Property 'find' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + return true; + }); + const testArrayFindIndex = [""].findIndex((val, idx, obj) => { + ~~~~~~~~~ +!!! error TS2550: Property 'findIndex' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + return true; + }); + const testArrayFill = [""].fill("fill"); + ~~~~ +!!! error TS2550: Property 'fill' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayCopyWithin = [""].copyWithin(0, 0); + ~~~~~~~~~~ +!!! error TS2550: Property 'copyWithin' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayEntries = [""].entries(); + ~~~~~~~ +!!! error TS2550: Property 'entries' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayKeys = [""].keys(); + ~~~~ +!!! error TS2550: Property 'keys' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayValues = [""].values(); + ~~~~~~ +!!! error TS2550: Property 'values' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayConstructorFrom = Array.from([]); + ~~~~ +!!! error TS2550: Property 'from' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testArrayConstructorOf = Array.of([]); + ~~ +!!! error TS2550: Property 'of' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testObjectConstructorAssign = Object.assign({}, {}); + ~~~~~~ +!!! error TS2550: Property 'assign' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2551: Property 'getOwnPropertySymbols' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyNames'? +!!! related TS2728 /.ts/lib.es5.d.ts:179:5: 'getOwnPropertyNames' is declared here. + const testObjectConstructorKeys = Object.keys({}); + const testObjectConstructorIs = Object.is({}, {}); + ~~ +!!! error TS2550: Property 'is' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); + ~~~~~~~~~~~~~~ +!!! error TS2551: Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'. Did you mean 'getPrototypeOf'? +!!! related TS2728 /.ts/lib.es5.d.ts:164:5: 'getPrototypeOf' is declared here. + const testNumberConstructorIsFinite = Number.isFinite(0); + ~~~~~~~~ +!!! error TS2550: Property 'isFinite' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testNumberConstructorIsInteger = Number.isInteger(0); + ~~~~~~~~~ +!!! error TS2550: Property 'isInteger' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testNumberConstructorIsNan = Number.isNaN(0); + ~~~~~ +!!! error TS2550: Property 'isNaN' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); + ~~~~~~~~~~~~~ +!!! error TS2550: Property 'isSafeInteger' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testNumberConstructorParseFloat = Number.parseFloat("0"); + ~~~~~~~~~~ +!!! error TS2550: Property 'parseFloat' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testNumberConstructorParseInt = Number.parseInt("0"); + ~~~~~~~~ +!!! error TS2550: Property 'parseInt' does not exist on type 'NumberConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathClz32 = Math.clz32(0); + ~~~~~ +!!! error TS2550: Property 'clz32' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathImul = Math.imul(0,0); + ~~~~ +!!! error TS2550: Property 'imul' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathSign = Math.sign(0); + ~~~~ +!!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? +!!! related TS2728 /.ts/lib.es5.d.ts:713:5: 'sin' is declared here. + const testMathLog10 = Math.log10(0); + ~~~~~ +!!! error TS2551: Property 'log10' does not exist on type 'Math'. Did you mean 'LOG10E'? +!!! related TS2728 /.ts/lib.es5.d.ts:627:14: 'LOG10E' is declared here. + const testMathLog2 = Math.log2(0); + ~~~~ +!!! error TS2551: Property 'log2' does not exist on type 'Math'. Did you mean 'LOG2E'? +!!! related TS2728 /.ts/lib.es5.d.ts:625:14: 'LOG2E' is declared here. + const testMathLog1p = Math.log1p(0); + ~~~~~ +!!! error TS2550: Property 'log1p' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathExpm1 = Math.expm1(0); + ~~~~~ +!!! error TS2550: Property 'expm1' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathCosh = Math.cosh(0); + ~~~~ +!!! error TS2551: Property 'cosh' does not exist on type 'Math'. Did you mean 'cos'? +!!! related TS2728 /.ts/lib.es5.d.ts:670:5: 'cos' is declared here. + const testMathSinh = Math.sinh(0); + ~~~~ +!!! error TS2551: Property 'sinh' does not exist on type 'Math'. Did you mean 'sin'? +!!! related TS2728 /.ts/lib.es5.d.ts:713:5: 'sin' is declared here. + const testMathTanh = Math.tanh(0); + ~~~~ +!!! error TS2551: Property 'tanh' does not exist on type 'Math'. Did you mean 'tan'? +!!! related TS2728 /.ts/lib.es5.d.ts:723:5: 'tan' is declared here. + const testMathAcosh = Math.acosh(0); + ~~~~~ +!!! error TS2551: Property 'acosh' does not exist on type 'Math'. Did you mean 'acos'? +!!! related TS2728 /.ts/lib.es5.d.ts:644:5: 'acos' is declared here. + const testMathAsinh = Math.asinh(0); + ~~~~~ +!!! error TS2551: Property 'asinh' does not exist on type 'Math'. Did you mean 'asin'? +!!! related TS2728 /.ts/lib.es5.d.ts:649:5: 'asin' is declared here. + const testMathAtanh = Math.atanh(0); + ~~~~~ +!!! error TS2551: Property 'atanh' does not exist on type 'Math'. Did you mean 'atan'? +!!! related TS2728 /.ts/lib.es5.d.ts:654:5: 'atan' is declared here. + const testMathHypot = Math.hypot(0,0); + ~~~~~ +!!! error TS2550: Property 'hypot' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathTrunc = Math.trunc(0); + ~~~~~ +!!! error TS2550: Property 'trunc' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMathFround = Math.fround(0); + ~~~~~~ +!!! error TS2551: Property 'fround' does not exist on type 'Math'. Did you mean 'round'? +!!! related TS2728 /.ts/lib.es5.d.ts:708:5: 'round' is declared here. + const testMathCbrt = Math.cbrt(0); + ~~~~ +!!! error TS2550: Property 'cbrt' does not exist on type 'Math'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testMap: Map = null as any; + ~~~ +!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testSet: Set = null as any; + ~~~ +!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testPromiseAll = Promise.all([]); + ~~~~~~~ +!!! error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testPromiseRace = Promise.race([]); + ~~~~~~~ +!!! error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testPromiseResolve = Promise.resolve(); + ~~~~~~~ +!!! error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testPromiseReject = Promise.reject(); + ~~~~~~~ +!!! error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testSymbolFor = Symbol.for('a'); + ~~~~~~ +!!! error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testSymbolKeyFor = Symbol.keyFor(testSymbolFor); + ~~~~~~ +!!! error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. + const testWeakMap: WeakMap = null as any; + ~~~~~~~ +!!! error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testWeakSet: WeakMap = null as any; + ~~~~~~~ +!!! error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testIterator: Iterator = null as any; + ~~~~~~~~ +!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testAsyncIterator: AsyncIterator = null as any; + ~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'AsyncIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringCodePointAt = "".codePointAt(0); + ~~~~~~~~~~~ +!!! error TS2550: Property 'codePointAt' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringIncludes = "".includes(""); + ~~~~~~~~ +!!! error TS2550: Property 'includes' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringEndsWith = "".endsWith(""); + ~~~~~~~~ +!!! error TS2550: Property 'endsWith' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringNormalize = "".normalize(); + ~~~~~~~~~ +!!! error TS2550: Property 'normalize' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringRepeat = "".repeat(0); + ~~~~~~ +!!! error TS2550: Property 'repeat' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringStartsWith = "".startsWith(""); + ~~~~~~~~~~ +!!! error TS2550: Property 'startsWith' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringAnchor = "".anchor(""); + ~~~~~~ +!!! error TS2550: Property 'anchor' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringBig = "".big(); + ~~~ +!!! error TS2550: Property 'big' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringBlink = "".blink(); + ~~~~~ +!!! error TS2550: Property 'blink' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringBold = "".bold(); + ~~~~ +!!! error TS2550: Property 'bold' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringFixed = "".fixed(); + ~~~~~ +!!! error TS2550: Property 'fixed' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringFontColor = "".fontcolor("blue"); + ~~~~~~~~~ +!!! error TS2550: Property 'fontcolor' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringFontSize = "".fontsize(0); + ~~~~~~~~ +!!! error TS2550: Property 'fontsize' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringItalics = "".italics(); + ~~~~~~~ +!!! error TS2550: Property 'italics' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringLink = "".link(""); + ~~~~ +!!! error TS2550: Property 'link' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringSmall = "".small(); + ~~~~~ +!!! error TS2550: Property 'small' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringStrike = "".strike(); + ~~~~~~ +!!! error TS2550: Property 'strike' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringSub = "".sub(); + ~~~ +!!! error TS2550: Property 'sub' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringSup = "".sup(); + ~~~ +!!! error TS2550: Property 'sup' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringConstructorFromCodePoint = String.fromCodePoint(); + ~~~~~~~~~~~~~ +!!! error TS2550: Property 'fromCodePoint' does not exist on type 'StringConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testStringConstructorRaw = String.raw``; + ~~~ +!!! error TS2550: Property 'raw' does not exist on type 'StringConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testRegExpFlags = /abc/g.flags; + ~~~~~ +!!! error TS2550: Property 'flags' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testRegExpSticky = /abc/g.sticky; + ~~~~~~ +!!! error TS2550: Property 'sticky' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + const testRegExpUnicode = /abc/g.unicode; + ~~~~~~~ +!!! error TS2550: Property 'unicode' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. + \ No newline at end of file diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.js b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.js new file mode 100644 index 00000000000..499187956e5 --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.js @@ -0,0 +1,190 @@ +//// [doYouNeedToChangeYourTargetLibraryES2015.ts] +// es2015 +const noOp = () => {}; +const testReflectApply = Reflect.apply(noOp, this, []); +const testReflectConstruct = Reflect.construct(noOp, []); +const testReflectDefineProperty = Reflect.defineProperty({}, "", {}); +const testReflectDeleteProperty = Reflect.deleteProperty({}, ""); +const testReflectGet = Reflect.get({}, ""); +const testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); +const testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); +const testReflectIsExtensible = Reflect.isExtensible({}); +const testReflectOwnKeys = Reflect.ownKeys({}); +const testReflectPreventExtensions = Reflect.preventExtensions({}); +const testReflectSet = Reflect.set({}, "", 0); +const testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); +const testArrayFind = [""].find((val, idx, obj) => { + return true; +}); +const testArrayFindIndex = [""].findIndex((val, idx, obj) => { + return true; +}); +const testArrayFill = [""].fill("fill"); +const testArrayCopyWithin = [""].copyWithin(0, 0); +const testArrayEntries = [""].entries(); +const testArrayKeys = [""].keys(); +const testArrayValues = [""].values(); +const testArrayConstructorFrom = Array.from([]); +const testArrayConstructorOf = Array.of([]); +const testObjectConstructorAssign = Object.assign({}, {}); +const testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); +const testObjectConstructorKeys = Object.keys({}); +const testObjectConstructorIs = Object.is({}, {}); +const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); +const testNumberConstructorIsFinite = Number.isFinite(0); +const testNumberConstructorIsInteger = Number.isInteger(0); +const testNumberConstructorIsNan = Number.isNaN(0); +const testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); +const testNumberConstructorParseFloat = Number.parseFloat("0"); +const testNumberConstructorParseInt = Number.parseInt("0"); +const testMathClz32 = Math.clz32(0); +const testMathImul = Math.imul(0,0); +const testMathSign = Math.sign(0); +const testMathLog10 = Math.log10(0); +const testMathLog2 = Math.log2(0); +const testMathLog1p = Math.log1p(0); +const testMathExpm1 = Math.expm1(0); +const testMathCosh = Math.cosh(0); +const testMathSinh = Math.sinh(0); +const testMathTanh = Math.tanh(0); +const testMathAcosh = Math.acosh(0); +const testMathAsinh = Math.asinh(0); +const testMathAtanh = Math.atanh(0); +const testMathHypot = Math.hypot(0,0); +const testMathTrunc = Math.trunc(0); +const testMathFround = Math.fround(0); +const testMathCbrt = Math.cbrt(0); +const testMap: Map = null as any; +const testSet: Set = null as any; +const testPromiseAll = Promise.all([]); +const testPromiseRace = Promise.race([]); +const testPromiseResolve = Promise.resolve(); +const testPromiseReject = Promise.reject(); +const testSymbolFor = Symbol.for('a'); +const testSymbolKeyFor = Symbol.keyFor(testSymbolFor); +const testWeakMap: WeakMap = null as any; +const testWeakSet: WeakMap = null as any; +const testIterator: Iterator = null as any; +const testAsyncIterator: AsyncIterator = null as any; +const testStringCodePointAt = "".codePointAt(0); +const testStringIncludes = "".includes(""); +const testStringEndsWith = "".endsWith(""); +const testStringNormalize = "".normalize(); +const testStringRepeat = "".repeat(0); +const testStringStartsWith = "".startsWith(""); +const testStringAnchor = "".anchor(""); +const testStringBig = "".big(); +const testStringBlink = "".blink(); +const testStringBold = "".bold(); +const testStringFixed = "".fixed(); +const testStringFontColor = "".fontcolor("blue"); +const testStringFontSize = "".fontsize(0); +const testStringItalics = "".italics(); +const testStringLink = "".link(""); +const testStringSmall = "".small(); +const testStringStrike = "".strike(); +const testStringSub = "".sub(); +const testStringSup = "".sup(); +const testStringConstructorFromCodePoint = String.fromCodePoint(); +const testStringConstructorRaw = String.raw``; +const testRegExpFlags = /abc/g.flags; +const testRegExpSticky = /abc/g.sticky; +const testRegExpUnicode = /abc/g.unicode; + + +//// [doYouNeedToChangeYourTargetLibraryES2015.js] +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +// es2015 +var noOp = function () { }; +var testReflectApply = Reflect.apply(noOp, this, []); +var testReflectConstruct = Reflect.construct(noOp, []); +var testReflectDefineProperty = Reflect.defineProperty({}, "", {}); +var testReflectDeleteProperty = Reflect.deleteProperty({}, ""); +var testReflectGet = Reflect.get({}, ""); +var testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); +var testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); +var testReflectIsExtensible = Reflect.isExtensible({}); +var testReflectOwnKeys = Reflect.ownKeys({}); +var testReflectPreventExtensions = Reflect.preventExtensions({}); +var testReflectSet = Reflect.set({}, "", 0); +var testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); +var testArrayFind = [""].find(function (val, idx, obj) { + return true; +}); +var testArrayFindIndex = [""].findIndex(function (val, idx, obj) { + return true; +}); +var testArrayFill = [""].fill("fill"); +var testArrayCopyWithin = [""].copyWithin(0, 0); +var testArrayEntries = [""].entries(); +var testArrayKeys = [""].keys(); +var testArrayValues = [""].values(); +var testArrayConstructorFrom = Array.from([]); +var testArrayConstructorOf = Array.of([]); +var testObjectConstructorAssign = Object.assign({}, {}); +var testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); +var testObjectConstructorKeys = Object.keys({}); +var testObjectConstructorIs = Object.is({}, {}); +var testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); +var testNumberConstructorIsFinite = Number.isFinite(0); +var testNumberConstructorIsInteger = Number.isInteger(0); +var testNumberConstructorIsNan = Number.isNaN(0); +var testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); +var testNumberConstructorParseFloat = Number.parseFloat("0"); +var testNumberConstructorParseInt = Number.parseInt("0"); +var testMathClz32 = Math.clz32(0); +var testMathImul = Math.imul(0, 0); +var testMathSign = Math.sign(0); +var testMathLog10 = Math.log10(0); +var testMathLog2 = Math.log2(0); +var testMathLog1p = Math.log1p(0); +var testMathExpm1 = Math.expm1(0); +var testMathCosh = Math.cosh(0); +var testMathSinh = Math.sinh(0); +var testMathTanh = Math.tanh(0); +var testMathAcosh = Math.acosh(0); +var testMathAsinh = Math.asinh(0); +var testMathAtanh = Math.atanh(0); +var testMathHypot = Math.hypot(0, 0); +var testMathTrunc = Math.trunc(0); +var testMathFround = Math.fround(0); +var testMathCbrt = Math.cbrt(0); +var testMap = null; +var testSet = null; +var testPromiseAll = Promise.all([]); +var testPromiseRace = Promise.race([]); +var testPromiseResolve = Promise.resolve(); +var testPromiseReject = Promise.reject(); +var testSymbolFor = Symbol["for"]('a'); +var testSymbolKeyFor = Symbol.keyFor(testSymbolFor); +var testWeakMap = null; +var testWeakSet = null; +var testIterator = null; +var testAsyncIterator = null; +var testStringCodePointAt = "".codePointAt(0); +var testStringIncludes = "".includes(""); +var testStringEndsWith = "".endsWith(""); +var testStringNormalize = "".normalize(); +var testStringRepeat = "".repeat(0); +var testStringStartsWith = "".startsWith(""); +var testStringAnchor = "".anchor(""); +var testStringBig = "".big(); +var testStringBlink = "".blink(); +var testStringBold = "".bold(); +var testStringFixed = "".fixed(); +var testStringFontColor = "".fontcolor("blue"); +var testStringFontSize = "".fontsize(0); +var testStringItalics = "".italics(); +var testStringLink = "".link(""); +var testStringSmall = "".small(); +var testStringStrike = "".strike(); +var testStringSub = "".sub(); +var testStringSup = "".sup(); +var testStringConstructorFromCodePoint = String.fromCodePoint(); +var testStringConstructorRaw = String.raw(__makeTemplateObject([""], [""])); +var testRegExpFlags = /abc/g.flags; +var testRegExpSticky = /abc/g.sticky; +var testRegExpUnicode = /abc/g.unicode; diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.symbols b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.symbols new file mode 100644 index 00000000000..7486af3881c --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.symbols @@ -0,0 +1,308 @@ +=== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts === +// es2015 +const noOp = () => {}; +>noOp : Symbol(noOp, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 1, 5)) + +const testReflectApply = Reflect.apply(noOp, this, []); +>testReflectApply : Symbol(testReflectApply, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 2, 5)) +>noOp : Symbol(noOp, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 1, 5)) +>this : Symbol(globalThis) + +const testReflectConstruct = Reflect.construct(noOp, []); +>testReflectConstruct : Symbol(testReflectConstruct, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 3, 5)) +>noOp : Symbol(noOp, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 1, 5)) + +const testReflectDefineProperty = Reflect.defineProperty({}, "", {}); +>testReflectDefineProperty : Symbol(testReflectDefineProperty, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 4, 5)) + +const testReflectDeleteProperty = Reflect.deleteProperty({}, ""); +>testReflectDeleteProperty : Symbol(testReflectDeleteProperty, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 5, 5)) + +const testReflectGet = Reflect.get({}, ""); +>testReflectGet : Symbol(testReflectGet, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 6, 5)) + +const testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); +>testReflectGetOwnPropertyDescriptor : Symbol(testReflectGetOwnPropertyDescriptor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 7, 5)) + +const testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); +>testReflectGetPrototypeOf : Symbol(testReflectGetPrototypeOf, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 8, 5)) + +const testReflectIsExtensible = Reflect.isExtensible({}); +>testReflectIsExtensible : Symbol(testReflectIsExtensible, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 9, 5)) + +const testReflectOwnKeys = Reflect.ownKeys({}); +>testReflectOwnKeys : Symbol(testReflectOwnKeys, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 10, 5)) + +const testReflectPreventExtensions = Reflect.preventExtensions({}); +>testReflectPreventExtensions : Symbol(testReflectPreventExtensions, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 11, 5)) + +const testReflectSet = Reflect.set({}, "", 0); +>testReflectSet : Symbol(testReflectSet, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 12, 5)) + +const testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); +>testReflectSetPrototypeOf : Symbol(testReflectSetPrototypeOf, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 13, 5)) + +const testArrayFind = [""].find((val, idx, obj) => { +>testArrayFind : Symbol(testArrayFind, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 14, 5)) +>val : Symbol(val, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 14, 33)) +>idx : Symbol(idx, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 14, 37)) +>obj : Symbol(obj, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 14, 42)) + + return true; +}); +const testArrayFindIndex = [""].findIndex((val, idx, obj) => { +>testArrayFindIndex : Symbol(testArrayFindIndex, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 17, 5)) +>val : Symbol(val, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 17, 43)) +>idx : Symbol(idx, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 17, 47)) +>obj : Symbol(obj, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 17, 52)) + + return true; +}); +const testArrayFill = [""].fill("fill"); +>testArrayFill : Symbol(testArrayFill, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 20, 5)) + +const testArrayCopyWithin = [""].copyWithin(0, 0); +>testArrayCopyWithin : Symbol(testArrayCopyWithin, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 21, 5)) + +const testArrayEntries = [""].entries(); +>testArrayEntries : Symbol(testArrayEntries, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 22, 5)) + +const testArrayKeys = [""].keys(); +>testArrayKeys : Symbol(testArrayKeys, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 23, 5)) + +const testArrayValues = [""].values(); +>testArrayValues : Symbol(testArrayValues, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 24, 5)) + +const testArrayConstructorFrom = Array.from([]); +>testArrayConstructorFrom : Symbol(testArrayConstructorFrom, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 25, 5)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testArrayConstructorOf = Array.of([]); +>testArrayConstructorOf : Symbol(testArrayConstructorOf, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 26, 5)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorAssign = Object.assign({}, {}); +>testObjectConstructorAssign : Symbol(testObjectConstructorAssign, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 27, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); +>testObjectConstructorGetOwnPropertySymbols : Symbol(testObjectConstructorGetOwnPropertySymbols, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 28, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorKeys = Object.keys({}); +>testObjectConstructorKeys : Symbol(testObjectConstructorKeys, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 29, 5)) +>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorIs = Object.is({}, {}); +>testObjectConstructorIs : Symbol(testObjectConstructorIs, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 30, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); +>testObjectConstructorSetPrototypeOf : Symbol(testObjectConstructorSetPrototypeOf, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 31, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorIsFinite = Number.isFinite(0); +>testNumberConstructorIsFinite : Symbol(testNumberConstructorIsFinite, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 32, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorIsInteger = Number.isInteger(0); +>testNumberConstructorIsInteger : Symbol(testNumberConstructorIsInteger, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 33, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorIsNan = Number.isNaN(0); +>testNumberConstructorIsNan : Symbol(testNumberConstructorIsNan, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 34, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); +>testNumberConstructorIsSafeInteger : Symbol(testNumberConstructorIsSafeInteger, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 35, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorParseFloat = Number.parseFloat("0"); +>testNumberConstructorParseFloat : Symbol(testNumberConstructorParseFloat, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 36, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testNumberConstructorParseInt = Number.parseInt("0"); +>testNumberConstructorParseInt : Symbol(testNumberConstructorParseInt, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 37, 5)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathClz32 = Math.clz32(0); +>testMathClz32 : Symbol(testMathClz32, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 38, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathImul = Math.imul(0,0); +>testMathImul : Symbol(testMathImul, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 39, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathSign = Math.sign(0); +>testMathSign : Symbol(testMathSign, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 40, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathLog10 = Math.log10(0); +>testMathLog10 : Symbol(testMathLog10, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 41, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathLog2 = Math.log2(0); +>testMathLog2 : Symbol(testMathLog2, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 42, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathLog1p = Math.log1p(0); +>testMathLog1p : Symbol(testMathLog1p, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 43, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathExpm1 = Math.expm1(0); +>testMathExpm1 : Symbol(testMathExpm1, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 44, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathCosh = Math.cosh(0); +>testMathCosh : Symbol(testMathCosh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 45, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathSinh = Math.sinh(0); +>testMathSinh : Symbol(testMathSinh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 46, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathTanh = Math.tanh(0); +>testMathTanh : Symbol(testMathTanh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 47, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathAcosh = Math.acosh(0); +>testMathAcosh : Symbol(testMathAcosh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 48, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathAsinh = Math.asinh(0); +>testMathAsinh : Symbol(testMathAsinh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 49, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathAtanh = Math.atanh(0); +>testMathAtanh : Symbol(testMathAtanh, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 50, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathHypot = Math.hypot(0,0); +>testMathHypot : Symbol(testMathHypot, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 51, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathTrunc = Math.trunc(0); +>testMathTrunc : Symbol(testMathTrunc, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 52, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathFround = Math.fround(0); +>testMathFround : Symbol(testMathFround, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 53, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMathCbrt = Math.cbrt(0); +>testMathCbrt : Symbol(testMathCbrt, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 54, 5)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testMap: Map = null as any; +>testMap : Symbol(testMap, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 55, 5)) + +const testSet: Set = null as any; +>testSet : Symbol(testSet, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 56, 5)) + +const testPromiseAll = Promise.all([]); +>testPromiseAll : Symbol(testPromiseAll, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 57, 5)) + +const testPromiseRace = Promise.race([]); +>testPromiseRace : Symbol(testPromiseRace, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 58, 5)) + +const testPromiseResolve = Promise.resolve(); +>testPromiseResolve : Symbol(testPromiseResolve, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 59, 5)) + +const testPromiseReject = Promise.reject(); +>testPromiseReject : Symbol(testPromiseReject, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 60, 5)) + +const testSymbolFor = Symbol.for('a'); +>testSymbolFor : Symbol(testSymbolFor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 61, 5)) + +const testSymbolKeyFor = Symbol.keyFor(testSymbolFor); +>testSymbolKeyFor : Symbol(testSymbolKeyFor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 62, 5)) +>testSymbolFor : Symbol(testSymbolFor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 61, 5)) + +const testWeakMap: WeakMap = null as any; +>testWeakMap : Symbol(testWeakMap, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 63, 5)) + +const testWeakSet: WeakMap = null as any; +>testWeakSet : Symbol(testWeakSet, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 64, 5)) + +const testIterator: Iterator = null as any; +>testIterator : Symbol(testIterator, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 65, 5)) + +const testAsyncIterator: AsyncIterator = null as any; +>testAsyncIterator : Symbol(testAsyncIterator, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 66, 5)) + +const testStringCodePointAt = "".codePointAt(0); +>testStringCodePointAt : Symbol(testStringCodePointAt, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 67, 5)) + +const testStringIncludes = "".includes(""); +>testStringIncludes : Symbol(testStringIncludes, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 68, 5)) + +const testStringEndsWith = "".endsWith(""); +>testStringEndsWith : Symbol(testStringEndsWith, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 69, 5)) + +const testStringNormalize = "".normalize(); +>testStringNormalize : Symbol(testStringNormalize, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 70, 5)) + +const testStringRepeat = "".repeat(0); +>testStringRepeat : Symbol(testStringRepeat, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 71, 5)) + +const testStringStartsWith = "".startsWith(""); +>testStringStartsWith : Symbol(testStringStartsWith, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 72, 5)) + +const testStringAnchor = "".anchor(""); +>testStringAnchor : Symbol(testStringAnchor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 73, 5)) + +const testStringBig = "".big(); +>testStringBig : Symbol(testStringBig, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 74, 5)) + +const testStringBlink = "".blink(); +>testStringBlink : Symbol(testStringBlink, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 75, 5)) + +const testStringBold = "".bold(); +>testStringBold : Symbol(testStringBold, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 76, 5)) + +const testStringFixed = "".fixed(); +>testStringFixed : Symbol(testStringFixed, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 77, 5)) + +const testStringFontColor = "".fontcolor("blue"); +>testStringFontColor : Symbol(testStringFontColor, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 78, 5)) + +const testStringFontSize = "".fontsize(0); +>testStringFontSize : Symbol(testStringFontSize, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 79, 5)) + +const testStringItalics = "".italics(); +>testStringItalics : Symbol(testStringItalics, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 80, 5)) + +const testStringLink = "".link(""); +>testStringLink : Symbol(testStringLink, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 81, 5)) + +const testStringSmall = "".small(); +>testStringSmall : Symbol(testStringSmall, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 82, 5)) + +const testStringStrike = "".strike(); +>testStringStrike : Symbol(testStringStrike, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 83, 5)) + +const testStringSub = "".sub(); +>testStringSub : Symbol(testStringSub, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 84, 5)) + +const testStringSup = "".sup(); +>testStringSup : Symbol(testStringSup, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 85, 5)) + +const testStringConstructorFromCodePoint = String.fromCodePoint(); +>testStringConstructorFromCodePoint : Symbol(testStringConstructorFromCodePoint, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 86, 5)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testStringConstructorRaw = String.raw``; +>testStringConstructorRaw : Symbol(testStringConstructorRaw, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 87, 5)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testRegExpFlags = /abc/g.flags; +>testRegExpFlags : Symbol(testRegExpFlags, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 88, 5)) + +const testRegExpSticky = /abc/g.sticky; +>testRegExpSticky : Symbol(testRegExpSticky, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 89, 5)) + +const testRegExpUnicode = /abc/g.unicode; +>testRegExpUnicode : Symbol(testRegExpUnicode, Decl(doYouNeedToChangeYourTargetLibraryES2015.ts, 90, 5)) + diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.types b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.types new file mode 100644 index 00000000000..301e0497298 --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2015.types @@ -0,0 +1,684 @@ +=== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts === +// es2015 +const noOp = () => {}; +>noOp : () => void +>() => {} : () => void + +const testReflectApply = Reflect.apply(noOp, this, []); +>testReflectApply : any +>Reflect.apply(noOp, this, []) : any +>Reflect.apply : any +>Reflect : any +>apply : any +>noOp : () => void +>this : typeof globalThis +>[] : undefined[] + +const testReflectConstruct = Reflect.construct(noOp, []); +>testReflectConstruct : any +>Reflect.construct(noOp, []) : any +>Reflect.construct : any +>Reflect : any +>construct : any +>noOp : () => void +>[] : undefined[] + +const testReflectDefineProperty = Reflect.defineProperty({}, "", {}); +>testReflectDefineProperty : any +>Reflect.defineProperty({}, "", {}) : any +>Reflect.defineProperty : any +>Reflect : any +>defineProperty : any +>{} : {} +>"" : "" +>{} : {} + +const testReflectDeleteProperty = Reflect.deleteProperty({}, ""); +>testReflectDeleteProperty : any +>Reflect.deleteProperty({}, "") : any +>Reflect.deleteProperty : any +>Reflect : any +>deleteProperty : any +>{} : {} +>"" : "" + +const testReflectGet = Reflect.get({}, ""); +>testReflectGet : any +>Reflect.get({}, "") : any +>Reflect.get : any +>Reflect : any +>get : any +>{} : {} +>"" : "" + +const testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); +>testReflectGetOwnPropertyDescriptor : any +>Reflect.getOwnPropertyDescriptor({}, "") : any +>Reflect.getOwnPropertyDescriptor : any +>Reflect : any +>getOwnPropertyDescriptor : any +>{} : {} +>"" : "" + +const testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); +>testReflectGetPrototypeOf : any +>Reflect.getPrototypeOf({}) : any +>Reflect.getPrototypeOf : any +>Reflect : any +>getPrototypeOf : any +>{} : {} + +const testReflectIsExtensible = Reflect.isExtensible({}); +>testReflectIsExtensible : any +>Reflect.isExtensible({}) : any +>Reflect.isExtensible : any +>Reflect : any +>isExtensible : any +>{} : {} + +const testReflectOwnKeys = Reflect.ownKeys({}); +>testReflectOwnKeys : any +>Reflect.ownKeys({}) : any +>Reflect.ownKeys : any +>Reflect : any +>ownKeys : any +>{} : {} + +const testReflectPreventExtensions = Reflect.preventExtensions({}); +>testReflectPreventExtensions : any +>Reflect.preventExtensions({}) : any +>Reflect.preventExtensions : any +>Reflect : any +>preventExtensions : any +>{} : {} + +const testReflectSet = Reflect.set({}, "", 0); +>testReflectSet : any +>Reflect.set({}, "", 0) : any +>Reflect.set : any +>Reflect : any +>set : any +>{} : {} +>"" : "" +>0 : 0 + +const testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); +>testReflectSetPrototypeOf : any +>Reflect.setPrototypeOf({}, {}) : any +>Reflect.setPrototypeOf : any +>Reflect : any +>setPrototypeOf : any +>{} : {} +>{} : {} + +const testArrayFind = [""].find((val, idx, obj) => { +>testArrayFind : any +>[""].find((val, idx, obj) => { return true;}) : any +>[""].find : any +>[""] : string[] +>"" : "" +>find : any +>(val, idx, obj) => { return true;} : (val: any, idx: any, obj: any) => boolean +>val : any +>idx : any +>obj : any + + return true; +>true : true + +}); +const testArrayFindIndex = [""].findIndex((val, idx, obj) => { +>testArrayFindIndex : any +>[""].findIndex((val, idx, obj) => { return true;}) : any +>[""].findIndex : any +>[""] : string[] +>"" : "" +>findIndex : any +>(val, idx, obj) => { return true;} : (val: any, idx: any, obj: any) => boolean +>val : any +>idx : any +>obj : any + + return true; +>true : true + +}); +const testArrayFill = [""].fill("fill"); +>testArrayFill : any +>[""].fill("fill") : any +>[""].fill : any +>[""] : string[] +>"" : "" +>fill : any +>"fill" : "fill" + +const testArrayCopyWithin = [""].copyWithin(0, 0); +>testArrayCopyWithin : any +>[""].copyWithin(0, 0) : any +>[""].copyWithin : any +>[""] : string[] +>"" : "" +>copyWithin : any +>0 : 0 +>0 : 0 + +const testArrayEntries = [""].entries(); +>testArrayEntries : any +>[""].entries() : any +>[""].entries : any +>[""] : string[] +>"" : "" +>entries : any + +const testArrayKeys = [""].keys(); +>testArrayKeys : any +>[""].keys() : any +>[""].keys : any +>[""] : string[] +>"" : "" +>keys : any + +const testArrayValues = [""].values(); +>testArrayValues : any +>[""].values() : any +>[""].values : any +>[""] : string[] +>"" : "" +>values : any + +const testArrayConstructorFrom = Array.from([]); +>testArrayConstructorFrom : any +>Array.from([]) : any +>Array.from : any +>Array : ArrayConstructor +>from : any +>[] : undefined[] + +const testArrayConstructorOf = Array.of([]); +>testArrayConstructorOf : any +>Array.of([]) : any +>Array.of : any +>Array : ArrayConstructor +>of : any +>[] : undefined[] + +const testObjectConstructorAssign = Object.assign({}, {}); +>testObjectConstructorAssign : any +>Object.assign({}, {}) : any +>Object.assign : any +>Object : ObjectConstructor +>assign : any +>{} : {} +>{} : {} + +const testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); +>testObjectConstructorGetOwnPropertySymbols : any +>Object.getOwnPropertySymbols({}) : any +>Object.getOwnPropertySymbols : any +>Object : ObjectConstructor +>getOwnPropertySymbols : any +>{} : {} + +const testObjectConstructorKeys = Object.keys({}); +>testObjectConstructorKeys : string[] +>Object.keys({}) : string[] +>Object.keys : (o: object) => string[] +>Object : ObjectConstructor +>keys : (o: object) => string[] +>{} : {} + +const testObjectConstructorIs = Object.is({}, {}); +>testObjectConstructorIs : any +>Object.is({}, {}) : any +>Object.is : any +>Object : ObjectConstructor +>is : any +>{} : {} +>{} : {} + +const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); +>testObjectConstructorSetPrototypeOf : any +>Object.setPrototypeOf({}, {}) : any +>Object.setPrototypeOf : any +>Object : ObjectConstructor +>setPrototypeOf : any +>{} : {} +>{} : {} + +const testNumberConstructorIsFinite = Number.isFinite(0); +>testNumberConstructorIsFinite : any +>Number.isFinite(0) : any +>Number.isFinite : any +>Number : NumberConstructor +>isFinite : any +>0 : 0 + +const testNumberConstructorIsInteger = Number.isInteger(0); +>testNumberConstructorIsInteger : any +>Number.isInteger(0) : any +>Number.isInteger : any +>Number : NumberConstructor +>isInteger : any +>0 : 0 + +const testNumberConstructorIsNan = Number.isNaN(0); +>testNumberConstructorIsNan : any +>Number.isNaN(0) : any +>Number.isNaN : any +>Number : NumberConstructor +>isNaN : any +>0 : 0 + +const testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); +>testNumberConstructorIsSafeInteger : any +>Number.isSafeInteger(0) : any +>Number.isSafeInteger : any +>Number : NumberConstructor +>isSafeInteger : any +>0 : 0 + +const testNumberConstructorParseFloat = Number.parseFloat("0"); +>testNumberConstructorParseFloat : any +>Number.parseFloat("0") : any +>Number.parseFloat : any +>Number : NumberConstructor +>parseFloat : any +>"0" : "0" + +const testNumberConstructorParseInt = Number.parseInt("0"); +>testNumberConstructorParseInt : any +>Number.parseInt("0") : any +>Number.parseInt : any +>Number : NumberConstructor +>parseInt : any +>"0" : "0" + +const testMathClz32 = Math.clz32(0); +>testMathClz32 : any +>Math.clz32(0) : any +>Math.clz32 : any +>Math : Math +>clz32 : any +>0 : 0 + +const testMathImul = Math.imul(0,0); +>testMathImul : any +>Math.imul(0,0) : any +>Math.imul : any +>Math : Math +>imul : any +>0 : 0 +>0 : 0 + +const testMathSign = Math.sign(0); +>testMathSign : any +>Math.sign(0) : any +>Math.sign : any +>Math : Math +>sign : any +>0 : 0 + +const testMathLog10 = Math.log10(0); +>testMathLog10 : any +>Math.log10(0) : any +>Math.log10 : any +>Math : Math +>log10 : any +>0 : 0 + +const testMathLog2 = Math.log2(0); +>testMathLog2 : any +>Math.log2(0) : any +>Math.log2 : any +>Math : Math +>log2 : any +>0 : 0 + +const testMathLog1p = Math.log1p(0); +>testMathLog1p : any +>Math.log1p(0) : any +>Math.log1p : any +>Math : Math +>log1p : any +>0 : 0 + +const testMathExpm1 = Math.expm1(0); +>testMathExpm1 : any +>Math.expm1(0) : any +>Math.expm1 : any +>Math : Math +>expm1 : any +>0 : 0 + +const testMathCosh = Math.cosh(0); +>testMathCosh : any +>Math.cosh(0) : any +>Math.cosh : any +>Math : Math +>cosh : any +>0 : 0 + +const testMathSinh = Math.sinh(0); +>testMathSinh : any +>Math.sinh(0) : any +>Math.sinh : any +>Math : Math +>sinh : any +>0 : 0 + +const testMathTanh = Math.tanh(0); +>testMathTanh : any +>Math.tanh(0) : any +>Math.tanh : any +>Math : Math +>tanh : any +>0 : 0 + +const testMathAcosh = Math.acosh(0); +>testMathAcosh : any +>Math.acosh(0) : any +>Math.acosh : any +>Math : Math +>acosh : any +>0 : 0 + +const testMathAsinh = Math.asinh(0); +>testMathAsinh : any +>Math.asinh(0) : any +>Math.asinh : any +>Math : Math +>asinh : any +>0 : 0 + +const testMathAtanh = Math.atanh(0); +>testMathAtanh : any +>Math.atanh(0) : any +>Math.atanh : any +>Math : Math +>atanh : any +>0 : 0 + +const testMathHypot = Math.hypot(0,0); +>testMathHypot : any +>Math.hypot(0,0) : any +>Math.hypot : any +>Math : Math +>hypot : any +>0 : 0 +>0 : 0 + +const testMathTrunc = Math.trunc(0); +>testMathTrunc : any +>Math.trunc(0) : any +>Math.trunc : any +>Math : Math +>trunc : any +>0 : 0 + +const testMathFround = Math.fround(0); +>testMathFround : any +>Math.fround(0) : any +>Math.fround : any +>Math : Math +>fround : any +>0 : 0 + +const testMathCbrt = Math.cbrt(0); +>testMathCbrt : any +>Math.cbrt(0) : any +>Math.cbrt : any +>Math : Math +>cbrt : any +>0 : 0 + +const testMap: Map = null as any; +>testMap : any +>null as any : any +>null : null + +const testSet: Set = null as any; +>testSet : any +>null as any : any +>null : null + +const testPromiseAll = Promise.all([]); +>testPromiseAll : any +>Promise.all([]) : any +>Promise.all : any +>Promise : any +>all : any +>[] : undefined[] + +const testPromiseRace = Promise.race([]); +>testPromiseRace : any +>Promise.race([]) : any +>Promise.race : any +>Promise : any +>race : any +>[] : undefined[] + +const testPromiseResolve = Promise.resolve(); +>testPromiseResolve : any +>Promise.resolve() : any +>Promise.resolve : any +>Promise : any +>resolve : any + +const testPromiseReject = Promise.reject(); +>testPromiseReject : any +>Promise.reject() : any +>Promise.reject : any +>Promise : any +>reject : any + +const testSymbolFor = Symbol.for('a'); +>testSymbolFor : any +>Symbol.for('a') : any +>Symbol.for : any +>Symbol : any +>for : any +>'a' : "a" + +const testSymbolKeyFor = Symbol.keyFor(testSymbolFor); +>testSymbolKeyFor : any +>Symbol.keyFor(testSymbolFor) : any +>Symbol.keyFor : any +>Symbol : any +>keyFor : any +>testSymbolFor : any + +const testWeakMap: WeakMap = null as any; +>testWeakMap : any +>null as any : any +>null : null + +const testWeakSet: WeakMap = null as any; +>testWeakSet : any +>null as any : any +>null : null + +const testIterator: Iterator = null as any; +>testIterator : any +>null as any : any +>null : null + +const testAsyncIterator: AsyncIterator = null as any; +>testAsyncIterator : any +>null as any : any +>null : null + +const testStringCodePointAt = "".codePointAt(0); +>testStringCodePointAt : any +>"".codePointAt(0) : any +>"".codePointAt : any +>"" : "" +>codePointAt : any +>0 : 0 + +const testStringIncludes = "".includes(""); +>testStringIncludes : any +>"".includes("") : any +>"".includes : any +>"" : "" +>includes : any +>"" : "" + +const testStringEndsWith = "".endsWith(""); +>testStringEndsWith : any +>"".endsWith("") : any +>"".endsWith : any +>"" : "" +>endsWith : any +>"" : "" + +const testStringNormalize = "".normalize(); +>testStringNormalize : any +>"".normalize() : any +>"".normalize : any +>"" : "" +>normalize : any + +const testStringRepeat = "".repeat(0); +>testStringRepeat : any +>"".repeat(0) : any +>"".repeat : any +>"" : "" +>repeat : any +>0 : 0 + +const testStringStartsWith = "".startsWith(""); +>testStringStartsWith : any +>"".startsWith("") : any +>"".startsWith : any +>"" : "" +>startsWith : any +>"" : "" + +const testStringAnchor = "".anchor(""); +>testStringAnchor : any +>"".anchor("") : any +>"".anchor : any +>"" : "" +>anchor : any +>"" : "" + +const testStringBig = "".big(); +>testStringBig : any +>"".big() : any +>"".big : any +>"" : "" +>big : any + +const testStringBlink = "".blink(); +>testStringBlink : any +>"".blink() : any +>"".blink : any +>"" : "" +>blink : any + +const testStringBold = "".bold(); +>testStringBold : any +>"".bold() : any +>"".bold : any +>"" : "" +>bold : any + +const testStringFixed = "".fixed(); +>testStringFixed : any +>"".fixed() : any +>"".fixed : any +>"" : "" +>fixed : any + +const testStringFontColor = "".fontcolor("blue"); +>testStringFontColor : any +>"".fontcolor("blue") : any +>"".fontcolor : any +>"" : "" +>fontcolor : any +>"blue" : "blue" + +const testStringFontSize = "".fontsize(0); +>testStringFontSize : any +>"".fontsize(0) : any +>"".fontsize : any +>"" : "" +>fontsize : any +>0 : 0 + +const testStringItalics = "".italics(); +>testStringItalics : any +>"".italics() : any +>"".italics : any +>"" : "" +>italics : any + +const testStringLink = "".link(""); +>testStringLink : any +>"".link("") : any +>"".link : any +>"" : "" +>link : any +>"" : "" + +const testStringSmall = "".small(); +>testStringSmall : any +>"".small() : any +>"".small : any +>"" : "" +>small : any + +const testStringStrike = "".strike(); +>testStringStrike : any +>"".strike() : any +>"".strike : any +>"" : "" +>strike : any + +const testStringSub = "".sub(); +>testStringSub : any +>"".sub() : any +>"".sub : any +>"" : "" +>sub : any + +const testStringSup = "".sup(); +>testStringSup : any +>"".sup() : any +>"".sup : any +>"" : "" +>sup : any + +const testStringConstructorFromCodePoint = String.fromCodePoint(); +>testStringConstructorFromCodePoint : any +>String.fromCodePoint() : any +>String.fromCodePoint : any +>String : StringConstructor +>fromCodePoint : any + +const testStringConstructorRaw = String.raw``; +>testStringConstructorRaw : any +>String.raw`` : any +>String.raw : any +>String : StringConstructor +>raw : any +>`` : "" + +const testRegExpFlags = /abc/g.flags; +>testRegExpFlags : any +>/abc/g.flags : any +>/abc/g : RegExp +>flags : any + +const testRegExpSticky = /abc/g.sticky; +>testRegExpSticky : any +>/abc/g.sticky : any +>/abc/g : RegExp +>sticky : any + +const testRegExpUnicode = /abc/g.unicode; +>testRegExpUnicode : any +>/abc/g.unicode : any +>/abc/g : RegExp +>unicode : any + diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt new file mode 100644 index 00000000000..24388413b3c --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -0,0 +1,147 @@ +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(2,32): error TS2550: Property 'includes' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2016' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(5,31): error TS2550: Property 'padStart' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(6,29): error TS2550: Property 'padEnd' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(7,44): error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(8,45): error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(9,63): error TS2551: Property 'getOwnPropertyDescriptors' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyDescriptor'? +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(10,64): error TS2550: Property 'formatToParts' does not exist on type 'DateTimeFormat'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(11,21): error TS2583: Cannot find name 'Atomics'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(12,35): error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(15,50): error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(16,113): error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,111): error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(18,33): error TS2550: Property 'dotAll' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(19,38): error TS2550: Property 'PluralRules' does not exist on type 'typeof Intl'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(20,27): error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(21,35): error TS2583: Cannot find name 'AsyncGeneratorFunction'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(22,26): error TS2583: Cannot find name 'AsyncIterable'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(23,34): error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(26,26): error TS2550: Property 'flat' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(27,29): error TS2550: Property 'flatMap' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(28,49): error TS2550: Property 'fromEntries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(29,32): error TS2550: Property 'trimStart' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(30,30): error TS2550: Property 'trimEnd' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(31,31): error TS2550: Property 'trimLeft' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(32,32): error TS2550: Property 'trimRight' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(33,45): error TS2550: Property 'description' does not exist on type 'symbol'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(36,53): error TS2550: Property 'allSettled' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(37,31): error TS2550: Property 'matchAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(38,47): error TS2550: Property 'matchAll' does not exist on type 'SymbolConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(39,20): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(42,46): error TS2550: Property 'any' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. +tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,70): error TS2550: Property 'formatToParts' does not exist on type 'NumberFormat'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. + + +==== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts (33 errors) ==== + // es2016 + const testIncludes = ["hello"].includes("world"); + ~~~~~~~~ +!!! error TS2550: Property 'includes' does not exist on type 'string[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2016' or later. + + // es2017 + const testStringPadStart = "".padStart(2); + ~~~~~~~~ +!!! error TS2550: Property 'padStart' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testStringPadEnd = "".padEnd(2); + ~~~~~~ +!!! error TS2550: Property 'padEnd' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testObjectConstructorValues = Object.values({}); + ~~~~~~ +!!! error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testObjectConstructorEntries = Object.entries({}); + ~~~~~~~ +!!! error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2551: Property 'getOwnPropertyDescriptors' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyDescriptor'? +!!! related TS2728 /.ts/lib.es5.d.ts:172:5: 'getOwnPropertyDescriptor' is declared here. + const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); + ~~~~~~~~~~~~~ +!!! error TS2550: Property 'formatToParts' does not exist on type 'DateTimeFormat'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testAtomics = Atomics.add(new Uint8Array(0), 0, 0); + ~~~~~~~ +!!! error TS2583: Cannot find name 'Atomics'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + const testSharedArrayBuffer = new SharedArrayBuffer(5); + ~~~~~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. + + // es2018 + const testPromiseFinally = new Promise(() => {}).finally(); + ~~~~~~~ +!!! error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; + ~~~~~~ +!!! error TS2550: Property 'groups' does not exist on type 'RegExpMatchArray'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; + ~~~~~~ +!!! error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testRegExpDotAll = /foo/g.dotAll; + ~~~~~~ +!!! error TS2550: Property 'dotAll' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); + ~~~~~~~~~~~ +!!! error TS2550: Property 'PluralRules' does not exist on type 'typeof Intl'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testAsyncGenerator: AsyncGenerator = null as any; + ~~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'AsyncGenerator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testAsyncGeneratorFunction: AsyncGeneratorFunction = null as any; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'AsyncGeneratorFunction'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testAsyncIterable: AsyncIterable = null as any; + ~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'AsyncIterable'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + const testAsyncIterableIterator: AsyncIterableIterator = null as any; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2583: Cannot find name 'AsyncIterableIterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2018' or later. + + // es2019 + const testArrayFlat = [].flat(); + ~~~~ +!!! error TS2550: Property 'flat' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testArrayFlatMap = [].flatMap(); + ~~~~~~~ +!!! error TS2550: Property 'flatMap' does not exist on type 'undefined[]'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testObjectConstructorFromEntries = Object.fromEntries({}); + ~~~~~~~~~~~ +!!! error TS2550: Property 'fromEntries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testStringTrimStart = "".trimStart(); + ~~~~~~~~~ +!!! error TS2550: Property 'trimStart' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testStringTrimEnd = "".trimEnd(); + ~~~~~~~ +!!! error TS2550: Property 'trimEnd' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testStringTrimLeft = "".trimLeft(); + ~~~~~~~~ +!!! error TS2550: Property 'trimLeft' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testStringTrimRight = "".trimRight(); + ~~~~~~~~~ +!!! error TS2550: Property 'trimRight' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + const testSymbolDescription = Symbol("foo").description; + ~~~~~~~~~~~ +!!! error TS2550: Property 'description' does not exist on type 'symbol'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2019' or later. + + // es2020 + const testPromiseAllSettled = new Promise(() => {}).allSettled(); + ~~~~~~~~~~ +!!! error TS2550: Property 'allSettled' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. + const testStringMatchAll = "".matchAll(); + ~~~~~~~~ +!!! error TS2550: Property 'matchAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. + const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); + ~~~~~~~~ +!!! error TS2550: Property 'matchAll' does not exist on type 'SymbolConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. + const testBigInt = BigInt(123); + ~~~~~~ +!!! error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later. + + // esnext + const testPromiseAny = new Promise(() => {}).any(); + ~~~ +!!! error TS2550: Property 'any' does not exist on type 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. + const testStringReplaceAll = "".replaceAll(); + ~~~~~~~~~~ +!!! error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. + const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); + ~~~~~~~~~~~~~ +!!! error TS2550: Property 'formatToParts' does not exist on type 'NumberFormat'. Do you need to change your target library? Try changing the `lib` compiler option to 'esnext' or later. \ No newline at end of file diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js new file mode 100644 index 00000000000..9dd50e73b6a --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.js @@ -0,0 +1,86 @@ +//// [doYouNeedToChangeYourTargetLibraryES2016Plus.ts] +// es2016 +const testIncludes = ["hello"].includes("world"); + +// es2017 +const testStringPadStart = "".padStart(2); +const testStringPadEnd = "".padEnd(2); +const testObjectConstructorValues = Object.values({}); +const testObjectConstructorEntries = Object.entries({}); +const testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); +const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); +const testAtomics = Atomics.add(new Uint8Array(0), 0, 0); +const testSharedArrayBuffer = new SharedArrayBuffer(5); + +// es2018 +const testPromiseFinally = new Promise(() => {}).finally(); +const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; +const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; +const testRegExpDotAll = /foo/g.dotAll; +const testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); +const testAsyncGenerator: AsyncGenerator = null as any; +const testAsyncGeneratorFunction: AsyncGeneratorFunction = null as any; +const testAsyncIterable: AsyncIterable = null as any; +const testAsyncIterableIterator: AsyncIterableIterator = null as any; + +// es2019 +const testArrayFlat = [].flat(); +const testArrayFlatMap = [].flatMap(); +const testObjectConstructorFromEntries = Object.fromEntries({}); +const testStringTrimStart = "".trimStart(); +const testStringTrimEnd = "".trimEnd(); +const testStringTrimLeft = "".trimLeft(); +const testStringTrimRight = "".trimRight(); +const testSymbolDescription = Symbol("foo").description; + +// es2020 +const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testStringMatchAll = "".matchAll(); +const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); +const testBigInt = BigInt(123); + +// esnext +const testPromiseAny = new Promise(() => {}).any(); +const testStringReplaceAll = "".replaceAll(); +const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); + +//// [doYouNeedToChangeYourTargetLibraryES2016Plus.js] +// es2016 +var testIncludes = ["hello"].includes("world"); +// es2017 +var testStringPadStart = "".padStart(2); +var testStringPadEnd = "".padEnd(2); +var testObjectConstructorValues = Object.values({}); +var testObjectConstructorEntries = Object.entries({}); +var testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); +var testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); +var testAtomics = Atomics.add(new Uint8Array(0), 0, 0); +var testSharedArrayBuffer = new SharedArrayBuffer(5); +// es2018 +var testPromiseFinally = new Promise(function () { })["finally"](); +var testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; +var testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; +var testRegExpDotAll = /foo/g.dotAll; +var testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); +var testAsyncGenerator = null; +var testAsyncGeneratorFunction = null; +var testAsyncIterable = null; +var testAsyncIterableIterator = null; +// es2019 +var testArrayFlat = [].flat(); +var testArrayFlatMap = [].flatMap(); +var testObjectConstructorFromEntries = Object.fromEntries({}); +var testStringTrimStart = "".trimStart(); +var testStringTrimEnd = "".trimEnd(); +var testStringTrimLeft = "".trimLeft(); +var testStringTrimRight = "".trimRight(); +var testSymbolDescription = Symbol("foo").description; +// es2020 +var testPromiseAllSettled = new Promise(function () { }).allSettled(); +var testStringMatchAll = "".matchAll(); +var testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); +var testBigInt = BigInt(123); +// esnext +var testPromiseAny = new Promise(function () { }).any(); +var testStringReplaceAll = "".replaceAll(); +var testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols new file mode 100644 index 00000000000..3ebf4065550 --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts === +// es2016 +const testIncludes = ["hello"].includes("world"); +>testIncludes : Symbol(testIncludes, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 1, 5)) + +// es2017 +const testStringPadStart = "".padStart(2); +>testStringPadStart : Symbol(testStringPadStart, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 4, 5)) + +const testStringPadEnd = "".padEnd(2); +>testStringPadEnd : Symbol(testStringPadEnd, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 5, 5)) + +const testObjectConstructorValues = Object.values({}); +>testObjectConstructorValues : Symbol(testObjectConstructorValues, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 6, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorEntries = Object.entries({}); +>testObjectConstructorEntries : Symbol(testObjectConstructorEntries, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); +>testObjectConstructorGetOwnPropertyDescriptors : Symbol(testObjectConstructorGetOwnPropertyDescriptors, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 8, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); +>testIntlFormatToParts : Symbol(testIntlFormatToParts, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 9, 5)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testAtomics = Atomics.add(new Uint8Array(0), 0, 0); +>testAtomics : Symbol(testAtomics, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 10, 5)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testSharedArrayBuffer = new SharedArrayBuffer(5); +>testSharedArrayBuffer : Symbol(testSharedArrayBuffer, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 11, 5)) + +// es2018 +const testPromiseFinally = new Promise(() => {}).finally(); +>testPromiseFinally : Symbol(testPromiseFinally, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 14, 5)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; +>testRegExpMatchArrayGroups : Symbol(testRegExpMatchArrayGroups, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 15, 5)) +>"2019-04-30".match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; +>testRegExpExecArrayGroups : Symbol(testRegExpExecArrayGroups, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 16, 5)) +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec : Symbol(RegExp.exec, Decl(lib.es5.d.ts, --, --)) +>exec : Symbol(RegExp.exec, Decl(lib.es5.d.ts, --, --)) + +const testRegExpDotAll = /foo/g.dotAll; +>testRegExpDotAll : Symbol(testRegExpDotAll, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 17, 5)) + +const testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); +>testIntlPluralRules : Symbol(testIntlPluralRules, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 18, 5)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) + +const testAsyncGenerator: AsyncGenerator = null as any; +>testAsyncGenerator : Symbol(testAsyncGenerator, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 19, 5)) + +const testAsyncGeneratorFunction: AsyncGeneratorFunction = null as any; +>testAsyncGeneratorFunction : Symbol(testAsyncGeneratorFunction, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 20, 5)) + +const testAsyncIterable: AsyncIterable = null as any; +>testAsyncIterable : Symbol(testAsyncIterable, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 21, 5)) + +const testAsyncIterableIterator: AsyncIterableIterator = null as any; +>testAsyncIterableIterator : Symbol(testAsyncIterableIterator, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 22, 5)) + +// es2019 +const testArrayFlat = [].flat(); +>testArrayFlat : Symbol(testArrayFlat, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 25, 5)) + +const testArrayFlatMap = [].flatMap(); +>testArrayFlatMap : Symbol(testArrayFlatMap, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 26, 5)) + +const testObjectConstructorFromEntries = Object.fromEntries({}); +>testObjectConstructorFromEntries : Symbol(testObjectConstructorFromEntries, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 27, 5)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const testStringTrimStart = "".trimStart(); +>testStringTrimStart : Symbol(testStringTrimStart, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 28, 5)) + +const testStringTrimEnd = "".trimEnd(); +>testStringTrimEnd : Symbol(testStringTrimEnd, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 29, 5)) + +const testStringTrimLeft = "".trimLeft(); +>testStringTrimLeft : Symbol(testStringTrimLeft, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 30, 5)) + +const testStringTrimRight = "".trimRight(); +>testStringTrimRight : Symbol(testStringTrimRight, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 31, 5)) + +const testSymbolDescription = Symbol("foo").description; +>testSymbolDescription : Symbol(testSymbolDescription, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 32, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +// es2020 +const testPromiseAllSettled = new Promise(() => {}).allSettled(); +>testPromiseAllSettled : Symbol(testPromiseAllSettled, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 35, 5)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testStringMatchAll = "".matchAll(); +>testStringMatchAll : Symbol(testStringMatchAll, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 36, 5)) + +const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); +>testRegExpMatchAll : Symbol(testRegExpMatchAll, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 37, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testBigInt = BigInt(123); +>testBigInt : Symbol(testBigInt, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 38, 5)) + +// esnext +const testPromiseAny = new Promise(() => {}).any(); +>testPromiseAny : Symbol(testPromiseAny, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 41, 5)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const testStringReplaceAll = "".replaceAll(); +>testStringReplaceAll : Symbol(testStringReplaceAll, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 42, 5)) + +const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); +>testNumberFormatFormatToParts : Symbol(testNumberFormatFormatToParts, Decl(doYouNeedToChangeYourTargetLibraryES2016Plus.ts, 43, 5)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --)) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types new file mode 100644 index 00000000000..6248a1e6b09 --- /dev/null +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types @@ -0,0 +1,269 @@ +=== tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts === +// es2016 +const testIncludes = ["hello"].includes("world"); +>testIncludes : any +>["hello"].includes("world") : any +>["hello"].includes : any +>["hello"] : string[] +>"hello" : "hello" +>includes : any +>"world" : "world" + +// es2017 +const testStringPadStart = "".padStart(2); +>testStringPadStart : any +>"".padStart(2) : any +>"".padStart : any +>"" : "" +>padStart : any +>2 : 2 + +const testStringPadEnd = "".padEnd(2); +>testStringPadEnd : any +>"".padEnd(2) : any +>"".padEnd : any +>"" : "" +>padEnd : any +>2 : 2 + +const testObjectConstructorValues = Object.values({}); +>testObjectConstructorValues : any +>Object.values({}) : any +>Object.values : any +>Object : ObjectConstructor +>values : any +>{} : {} + +const testObjectConstructorEntries = Object.entries({}); +>testObjectConstructorEntries : any +>Object.entries({}) : any +>Object.entries : any +>Object : ObjectConstructor +>entries : any +>{} : {} + +const testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); +>testObjectConstructorGetOwnPropertyDescriptors : any +>Object.getOwnPropertyDescriptors({}) : any +>Object.getOwnPropertyDescriptors : any +>Object : ObjectConstructor +>getOwnPropertyDescriptors : any +>{} : {} + +const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); +>testIntlFormatToParts : any +>new Intl.DateTimeFormat("en-US").formatToParts() : any +>new Intl.DateTimeFormat("en-US").formatToParts : any +>new Intl.DateTimeFormat("en-US") : Intl.DateTimeFormat +>Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; } +>Intl : typeof Intl +>DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; } +>"en-US" : "en-US" +>formatToParts : any + +const testAtomics = Atomics.add(new Uint8Array(0), 0, 0); +>testAtomics : any +>Atomics.add(new Uint8Array(0), 0, 0) : any +>Atomics.add : any +>Atomics : any +>add : any +>new Uint8Array(0) : Uint8Array +>Uint8Array : Uint8ArrayConstructor +>0 : 0 +>0 : 0 +>0 : 0 + +const testSharedArrayBuffer = new SharedArrayBuffer(5); +>testSharedArrayBuffer : any +>new SharedArrayBuffer(5) : any +>SharedArrayBuffer : any +>5 : 5 + +// es2018 +const testPromiseFinally = new Promise(() => {}).finally(); +>testPromiseFinally : any +>new Promise(() => {}).finally() : any +>new Promise(() => {}).finally : any +>new Promise(() => {}) : Promise +>Promise : PromiseConstructor +>() => {} : () => void +>finally : any + +const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; +>testRegExpMatchArrayGroups : any +>"2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups : any +>"2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g) : RegExpMatchArray +>"2019-04-30".match : { (regexp: string | RegExp): RegExpMatchArray; (matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; } +>"2019-04-30" : "2019-04-30" +>match : { (regexp: string | RegExp): RegExpMatchArray; (matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; } +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g : RegExp +>groups : any + +const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; +>testRegExpExecArrayGroups : any +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups : any +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30") : RegExpExecArray +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec : (string: string) => RegExpExecArray +>/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g : RegExp +>exec : (string: string) => RegExpExecArray +>"2019-04-30" : "2019-04-30" +>groups : any + +const testRegExpDotAll = /foo/g.dotAll; +>testRegExpDotAll : any +>/foo/g.dotAll : any +>/foo/g : RegExp +>dotAll : any + +const testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); +>testIntlPluralRules : any +>new Intl.PluralRules("ar-EG").select(0) : any +>new Intl.PluralRules("ar-EG").select : any +>new Intl.PluralRules("ar-EG") : any +>Intl.PluralRules : any +>Intl : typeof Intl +>PluralRules : any +>"ar-EG" : "ar-EG" +>select : any +>0 : 0 + +const testAsyncGenerator: AsyncGenerator = null as any; +>testAsyncGenerator : any +>null as any : any +>null : null + +const testAsyncGeneratorFunction: AsyncGeneratorFunction = null as any; +>testAsyncGeneratorFunction : any +>null as any : any +>null : null + +const testAsyncIterable: AsyncIterable = null as any; +>testAsyncIterable : any +>null as any : any +>null : null + +const testAsyncIterableIterator: AsyncIterableIterator = null as any; +>testAsyncIterableIterator : any +>null as any : any +>null : null + +// es2019 +const testArrayFlat = [].flat(); +>testArrayFlat : any +>[].flat() : any +>[].flat : any +>[] : undefined[] +>flat : any + +const testArrayFlatMap = [].flatMap(); +>testArrayFlatMap : any +>[].flatMap() : any +>[].flatMap : any +>[] : undefined[] +>flatMap : any + +const testObjectConstructorFromEntries = Object.fromEntries({}); +>testObjectConstructorFromEntries : any +>Object.fromEntries({}) : any +>Object.fromEntries : any +>Object : ObjectConstructor +>fromEntries : any +>{} : {} + +const testStringTrimStart = "".trimStart(); +>testStringTrimStart : any +>"".trimStart() : any +>"".trimStart : any +>"" : "" +>trimStart : any + +const testStringTrimEnd = "".trimEnd(); +>testStringTrimEnd : any +>"".trimEnd() : any +>"".trimEnd : any +>"" : "" +>trimEnd : any + +const testStringTrimLeft = "".trimLeft(); +>testStringTrimLeft : any +>"".trimLeft() : any +>"".trimLeft : any +>"" : "" +>trimLeft : any + +const testStringTrimRight = "".trimRight(); +>testStringTrimRight : any +>"".trimRight() : any +>"".trimRight : any +>"" : "" +>trimRight : any + +const testSymbolDescription = Symbol("foo").description; +>testSymbolDescription : any +>Symbol("foo").description : any +>Symbol("foo") : symbol +>Symbol : SymbolConstructor +>"foo" : "foo" +>description : any + +// es2020 +const testPromiseAllSettled = new Promise(() => {}).allSettled(); +>testPromiseAllSettled : any +>new Promise(() => {}).allSettled() : any +>new Promise(() => {}).allSettled : any +>new Promise(() => {}) : Promise +>Promise : PromiseConstructor +>() => {} : () => void +>allSettled : any + +const testStringMatchAll = "".matchAll(); +>testStringMatchAll : any +>"".matchAll() : any +>"".matchAll : any +>"" : "" +>matchAll : any + +const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); +>testRegExpMatchAll : any +>/matchAll/g[Symbol.matchAll]("matchAll") : any +>/matchAll/g[Symbol.matchAll] : any +>/matchAll/g : RegExp +>Symbol.matchAll : any +>Symbol : SymbolConstructor +>matchAll : any +>"matchAll" : "matchAll" + +const testBigInt = BigInt(123); +>testBigInt : any +>BigInt(123) : any +>BigInt : any +>123 : 123 + +// esnext +const testPromiseAny = new Promise(() => {}).any(); +>testPromiseAny : any +>new Promise(() => {}).any() : any +>new Promise(() => {}).any : any +>new Promise(() => {}) : Promise +>Promise : PromiseConstructor +>() => {} : () => void +>any : any + +const testStringReplaceAll = "".replaceAll(); +>testStringReplaceAll : any +>"".replaceAll() : any +>"".replaceAll : any +>"" : "" +>replaceAll : any + +const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); +>testNumberFormatFormatToParts : any +>new Intl.NumberFormat("en-US").formatToParts() : any +>new Intl.NumberFormat("en-US").formatToParts : any +>new Intl.NumberFormat("en-US") : Intl.NumberFormat +>Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; } +>Intl : typeof Intl +>NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; } +>"en-US" : "en-US" +>formatToParts : any + diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt index db1b2840132..5f6cdba051c 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(4,18): error TS2339: Property 'from' does not exist on type 'ArrayConstructor'. -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(10,13): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(4,18): error TS2550: Property 'from' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(10,13): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(17,5): error TS2339: Property 'name' does not exist on type '() => void'. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(20,6): error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(25,6): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(29,18): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(33,13): error TS2304: Cannot find name 'Proxy'. -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(36,1): error TS2304: Cannot find name 'Reflect'. -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(40,5): error TS2339: Property 'flags' does not exist on type 'RegExp'. -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(44,5): error TS2339: Property 'includes' does not exist on type 'string'. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(36,1): error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(40,5): error TS2550: Property 'flags' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(44,5): error TS2550: Property 'includes' does not exist on type 'string'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(47,9): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts(51,6): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. @@ -18,7 +18,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t function f(x: number, y: number, z: number) { return Array.from(arguments); ~~~~ -!!! error TS2339: Property 'from' does not exist on type 'ArrayConstructor'. +!!! error TS2550: Property 'from' does not exist on type 'ArrayConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. } f(1, 2, 3); // no error @@ -26,7 +26,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t // Using ES6 collection var m = new Map(); ~~~ -!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. m.clear(); // Using ES6 iterable m.keys(); @@ -65,19 +65,19 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t // Using ES6 reflect Reflect.isExtensible({}); ~~~~~~~ -!!! error TS2304: Cannot find name 'Reflect'. +!!! error TS2583: Cannot find name 'Reflect'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. // Using Es6 regexp var reg = new RegExp("/s"); reg.flags; ~~~~~ -!!! error TS2339: Property 'flags' does not exist on type 'RegExp'. +!!! error TS2550: Property 'flags' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. // Using ES6 string var str = "Hello world"; str.includes("hello", 0); ~~~~~~~~ -!!! error TS2339: Property 'includes' does not exist on type 'string'. +!!! error TS2550: Property 'includes' does not exist on type 'string'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. // Using ES6 symbol var s = Symbol(); diff --git a/tests/baselines/reference/parserMissingLambdaOpenBrace1.errors.txt b/tests/baselines/reference/parserMissingLambdaOpenBrace1.errors.txt index c724b594159..aa18dfc68a4 100644 --- a/tests/baselines/reference/parserMissingLambdaOpenBrace1.errors.txt +++ b/tests/baselines/reference/parserMissingLambdaOpenBrace1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpenBrace1.ts(2,19): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpenBrace1.ts(2,19): error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpenBrace1.ts(2,28): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpenBrace1.ts(2,42): error TS2304: Cannot find name 'Query'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpenBrace1.ts(2,48): error TS2304: Cannot find name 'T'. @@ -11,7 +11,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserMissingLambdaOpen class C { where(filter: Iterator): Query { ~~~~~~~~ -!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +!!! error TS2583: Cannot find name 'Iterator'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. ~ !!! error TS2304: Cannot find name 'T'. ~~~~~ diff --git a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js index 20ee37173e7..a40c9df94d1 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js @@ -28,7 +28,7 @@ Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... -src/app.ts:1:8 - error TS2583: Cannot find name 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +src/app.ts:1:8 - error TS2583: Cannot find name 'Promise'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2015' or later. 1 var x: Promise;    ~~~~~~~ diff --git a/tests/baselines/reference/useObjectValuesAndEntries2.errors.txt b/tests/baselines/reference/useObjectValuesAndEntries2.errors.txt index 37a92aba7bd..a4b7fd20113 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries2.errors.txt +++ b/tests/baselines/reference/useObjectValuesAndEntries2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts(3,22): error TS2339: Property 'values' does not exist on type 'ObjectConstructor'. -tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts(7,22): error TS2339: Property 'entries' does not exist on type 'ObjectConstructor'. +tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts(3,22): error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts(7,22): error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. ==== tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/conformance/es2017/useObjectValuesAndEntries2.ts(7,22): error TS2339 for (var x of Object.values(o)) { ~~~~~~ -!!! error TS2339: Property 'values' does not exist on type 'ObjectConstructor'. +!!! error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. let y = x; } var entries = Object.entries(o); ~~~~~~~ -!!! error TS2339: Property 'entries' does not exist on type 'ObjectConstructor'. \ No newline at end of file +!!! error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. \ No newline at end of file diff --git a/tests/baselines/reference/useObjectValuesAndEntries3.errors.txt b/tests/baselines/reference/useObjectValuesAndEntries3.errors.txt index 506c708b997..9ac8cdc8a89 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries3.errors.txt +++ b/tests/baselines/reference/useObjectValuesAndEntries3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts(3,22): error TS2339: Property 'values' does not exist on type 'ObjectConstructor'. -tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts(7,22): error TS2339: Property 'entries' does not exist on type 'ObjectConstructor'. +tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts(3,22): error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. +tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts(7,22): error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. ==== tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/conformance/es2017/useObjectValuesAndEntries3.ts(7,22): error TS2339 for (var x of Object.values(o)) { ~~~~~~ -!!! error TS2339: Property 'values' does not exist on type 'ObjectConstructor'. +!!! error TS2550: Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. let y = x; } var entries = Object.entries(o); ~~~~~~~ -!!! error TS2339: Property 'entries' does not exist on type 'ObjectConstructor'. \ No newline at end of file +!!! error TS2550: Property 'entries' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. \ No newline at end of file diff --git a/tests/baselines/reference/useSharedArrayBuffer2.errors.txt b/tests/baselines/reference/useSharedArrayBuffer2.errors.txt index 6b3573c3e89..f07150f6834 100644 --- a/tests/baselines/reference/useSharedArrayBuffer2.errors.txt +++ b/tests/baselines/reference/useSharedArrayBuffer2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es2017/useSharedArrayBuffer2.ts(1,16): error TS2304: Cannot find name 'SharedArrayBuffer'. +tests/cases/conformance/es2017/useSharedArrayBuffer2.ts(1,16): error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. ==== tests/cases/conformance/es2017/useSharedArrayBuffer2.ts (1 errors) ==== var foge = new SharedArrayBuffer(1024); ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'SharedArrayBuffer'. +!!! error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. var bar = foge.slice(1, 10); var len = foge.byteLength; \ No newline at end of file diff --git a/tests/baselines/reference/useSharedArrayBuffer3.errors.txt b/tests/baselines/reference/useSharedArrayBuffer3.errors.txt index c8000badc07..049cd97e97e 100644 --- a/tests/baselines/reference/useSharedArrayBuffer3.errors.txt +++ b/tests/baselines/reference/useSharedArrayBuffer3.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es2017/useSharedArrayBuffer3.ts(1,16): error TS2304: Cannot find name 'SharedArrayBuffer'. +tests/cases/conformance/es2017/useSharedArrayBuffer3.ts(1,16): error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. ==== tests/cases/conformance/es2017/useSharedArrayBuffer3.ts (1 errors) ==== var foge = new SharedArrayBuffer(1024); ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'SharedArrayBuffer'. +!!! error TS2583: Cannot find name 'SharedArrayBuffer'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2017' or later. var bar = foge.slice(1, 10); var len = foge.byteLength; \ No newline at end of file diff --git a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts new file mode 100644 index 00000000000..8877444da1e --- /dev/null +++ b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts @@ -0,0 +1,91 @@ +// es2015 +const noOp = () => {}; +const testReflectApply = Reflect.apply(noOp, this, []); +const testReflectConstruct = Reflect.construct(noOp, []); +const testReflectDefineProperty = Reflect.defineProperty({}, "", {}); +const testReflectDeleteProperty = Reflect.deleteProperty({}, ""); +const testReflectGet = Reflect.get({}, ""); +const testReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor({}, ""); +const testReflectGetPrototypeOf = Reflect.getPrototypeOf({}); +const testReflectIsExtensible = Reflect.isExtensible({}); +const testReflectOwnKeys = Reflect.ownKeys({}); +const testReflectPreventExtensions = Reflect.preventExtensions({}); +const testReflectSet = Reflect.set({}, "", 0); +const testReflectSetPrototypeOf = Reflect.setPrototypeOf({}, {}); +const testArrayFind = [""].find((val, idx, obj) => { + return true; +}); +const testArrayFindIndex = [""].findIndex((val, idx, obj) => { + return true; +}); +const testArrayFill = [""].fill("fill"); +const testArrayCopyWithin = [""].copyWithin(0, 0); +const testArrayEntries = [""].entries(); +const testArrayKeys = [""].keys(); +const testArrayValues = [""].values(); +const testArrayConstructorFrom = Array.from([]); +const testArrayConstructorOf = Array.of([]); +const testObjectConstructorAssign = Object.assign({}, {}); +const testObjectConstructorGetOwnPropertySymbols = Object.getOwnPropertySymbols({}); +const testObjectConstructorKeys = Object.keys({}); +const testObjectConstructorIs = Object.is({}, {}); +const testObjectConstructorSetPrototypeOf = Object.setPrototypeOf({}, {}); +const testNumberConstructorIsFinite = Number.isFinite(0); +const testNumberConstructorIsInteger = Number.isInteger(0); +const testNumberConstructorIsNan = Number.isNaN(0); +const testNumberConstructorIsSafeInteger = Number.isSafeInteger(0); +const testNumberConstructorParseFloat = Number.parseFloat("0"); +const testNumberConstructorParseInt = Number.parseInt("0"); +const testMathClz32 = Math.clz32(0); +const testMathImul = Math.imul(0,0); +const testMathSign = Math.sign(0); +const testMathLog10 = Math.log10(0); +const testMathLog2 = Math.log2(0); +const testMathLog1p = Math.log1p(0); +const testMathExpm1 = Math.expm1(0); +const testMathCosh = Math.cosh(0); +const testMathSinh = Math.sinh(0); +const testMathTanh = Math.tanh(0); +const testMathAcosh = Math.acosh(0); +const testMathAsinh = Math.asinh(0); +const testMathAtanh = Math.atanh(0); +const testMathHypot = Math.hypot(0,0); +const testMathTrunc = Math.trunc(0); +const testMathFround = Math.fround(0); +const testMathCbrt = Math.cbrt(0); +const testMap: Map = null as any; +const testSet: Set = null as any; +const testPromiseAll = Promise.all([]); +const testPromiseRace = Promise.race([]); +const testPromiseResolve = Promise.resolve(); +const testPromiseReject = Promise.reject(); +const testSymbolFor = Symbol.for('a'); +const testSymbolKeyFor = Symbol.keyFor(testSymbolFor); +const testWeakMap: WeakMap = null as any; +const testWeakSet: WeakMap = null as any; +const testIterator: Iterator = null as any; +const testAsyncIterator: AsyncIterator = null as any; +const testStringCodePointAt = "".codePointAt(0); +const testStringIncludes = "".includes(""); +const testStringEndsWith = "".endsWith(""); +const testStringNormalize = "".normalize(); +const testStringRepeat = "".repeat(0); +const testStringStartsWith = "".startsWith(""); +const testStringAnchor = "".anchor(""); +const testStringBig = "".big(); +const testStringBlink = "".blink(); +const testStringBold = "".bold(); +const testStringFixed = "".fixed(); +const testStringFontColor = "".fontcolor("blue"); +const testStringFontSize = "".fontsize(0); +const testStringItalics = "".italics(); +const testStringLink = "".link(""); +const testStringSmall = "".small(); +const testStringStrike = "".strike(); +const testStringSub = "".sub(); +const testStringSup = "".sup(); +const testStringConstructorFromCodePoint = String.fromCodePoint(); +const testStringConstructorRaw = String.raw``; +const testRegExpFlags = /abc/g.flags; +const testRegExpSticky = /abc/g.sticky; +const testRegExpUnicode = /abc/g.unicode; diff --git a/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts new file mode 100644 index 00000000000..901d53c021a --- /dev/null +++ b/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts @@ -0,0 +1,46 @@ +// @lib: es2015 + +// es2016 +const testIncludes = ["hello"].includes("world"); + +// es2017 +const testStringPadStart = "".padStart(2); +const testStringPadEnd = "".padEnd(2); +const testObjectConstructorValues = Object.values({}); +const testObjectConstructorEntries = Object.entries({}); +const testObjectConstructorGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors({}); +const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); +const testAtomics = Atomics.add(new Uint8Array(0), 0, 0); +const testSharedArrayBuffer = new SharedArrayBuffer(5); + +// es2018 +const testPromiseFinally = new Promise(() => {}).finally(); +const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; +const testRegExpExecArrayGroups = /(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g.exec("2019-04-30").groups; +const testRegExpDotAll = /foo/g.dotAll; +const testIntlPluralRules = new Intl.PluralRules("ar-EG").select(0); +const testAsyncGenerator: AsyncGenerator = null as any; +const testAsyncGeneratorFunction: AsyncGeneratorFunction = null as any; +const testAsyncIterable: AsyncIterable = null as any; +const testAsyncIterableIterator: AsyncIterableIterator = null as any; + +// es2019 +const testArrayFlat = [].flat(); +const testArrayFlatMap = [].flatMap(); +const testObjectConstructorFromEntries = Object.fromEntries({}); +const testStringTrimStart = "".trimStart(); +const testStringTrimEnd = "".trimEnd(); +const testStringTrimLeft = "".trimLeft(); +const testStringTrimRight = "".trimRight(); +const testSymbolDescription = Symbol("foo").description; + +// es2020 +const testPromiseAllSettled = new Promise(() => {}).allSettled(); +const testStringMatchAll = "".matchAll(); +const testRegExpMatchAll = /matchAll/g[Symbol.matchAll]("matchAll"); +const testBigInt = BigInt(123); + +// esnext +const testPromiseAny = new Promise(() => {}).any(); +const testStringReplaceAll = "".replaceAll(); +const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToParts(); \ No newline at end of file