mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove target=es3 (#57525)
This commit is contained in:
@@ -50,7 +50,6 @@ export * from "../transformers/esnext";
|
||||
export * from "../transformers/jsx";
|
||||
export * from "../transformers/es2016";
|
||||
export * from "../transformers/es2015";
|
||||
export * from "../transformers/es5";
|
||||
export * from "../transformers/generators";
|
||||
export * from "../transformers/module/module";
|
||||
export * from "../transformers/module/system";
|
||||
|
||||
@@ -2573,14 +2573,14 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
// Provide specialized messages to help the user understand why we think they're in
|
||||
// strict mode.
|
||||
if (getContainingClass(node)) {
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode;
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Class_definitions_are_automatically_in_strict_mode;
|
||||
}
|
||||
|
||||
if (file.externalModuleIndicator) {
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode;
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5_Modules_are_automatically_in_strict_mode;
|
||||
}
|
||||
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5;
|
||||
return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES5;
|
||||
}
|
||||
|
||||
function checkStrictModeFunctionDeclaration(node: FunctionDeclaration) {
|
||||
|
||||
+15
-40
@@ -6571,7 +6571,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return parentName;
|
||||
}
|
||||
const memberName = symbolName(type.symbol);
|
||||
if (isIdentifierText(memberName, ScriptTarget.ES3)) {
|
||||
if (isIdentifierText(memberName, ScriptTarget.ES5)) {
|
||||
return appendReferenceToType(
|
||||
parentName as TypeReferenceNode | ImportTypeNode,
|
||||
factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined),
|
||||
@@ -29269,10 +29269,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (container) {
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
if (container.kind === SyntaxKind.ArrowFunction) {
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES5_Consider_using_a_standard_function_expression);
|
||||
}
|
||||
else if (hasSyntacticModifier(container, ModifierFlags.Async)) {
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES5_Consider_using_a_standard_function_or_method);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34408,8 +34408,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
// For ES3 or decorators with only two parameters we supply only two arguments
|
||||
return languageVersion === ScriptTarget.ES3 || signature.parameters.length <= 2 ? 2 : 3;
|
||||
// For decorators with only two parameters we supply only two arguments
|
||||
return signature.parameters.length <= 2 ? 2 : 3;
|
||||
case SyntaxKind.Parameter:
|
||||
return 3;
|
||||
default:
|
||||
@@ -35166,13 +35166,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[] | undefined, checkMode: CheckMode): Signature {
|
||||
if (node.arguments && languageVersion < ScriptTarget.ES5) {
|
||||
const spreadIndex = getSpreadArgumentIndex(node.arguments);
|
||||
if (spreadIndex >= 0) {
|
||||
error(node.arguments[spreadIndex], Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher);
|
||||
}
|
||||
}
|
||||
|
||||
let expressionType = checkNonNullExpression(node.expression);
|
||||
if (expressionType === silentNeverType) {
|
||||
return silentNeverSignature;
|
||||
@@ -36990,8 +36983,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (!isClassLike(node.parent)) break;
|
||||
|
||||
// A method or accessor declaration decorator will have either two or three arguments (see
|
||||
// `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators for
|
||||
// ES3, we will only pass two arguments.
|
||||
// `PropertyDecorator` and `MethodDecorator` in core.d.ts).
|
||||
|
||||
const targetType = getParentTypeOfClassElement(node);
|
||||
const targetParam = createParameter("target" as __String, targetType);
|
||||
@@ -37002,7 +36994,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const returnType = isPropertyDeclaration(node) ? voidType :
|
||||
createTypedPropertyDescriptorType(getTypeOfNode(node));
|
||||
|
||||
const hasPropDesc = languageVersion !== ScriptTarget.ES3 && (!isPropertyDeclaration(parent) || hasAccessorModifier(parent));
|
||||
const hasPropDesc = !isPropertyDeclaration(parent) || hasAccessorModifier(parent);
|
||||
if (hasPropDesc) {
|
||||
const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node));
|
||||
const descriptorParam = createParameter("descriptor" as __String, descriptorType);
|
||||
@@ -37074,8 +37066,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
error(
|
||||
func,
|
||||
isImportCall(func) ?
|
||||
Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option,
|
||||
Diagnostics.A_dynamic_import_call_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41465,7 +41457,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
const promiseConstructorName = getEntityNameFromTypeNode(returnTypeNode);
|
||||
if (promiseConstructorName === undefined) {
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, typeToString(returnType));
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, typeToString(returnType));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41473,10 +41465,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
|
||||
if (isErrorType(promiseConstructorType)) {
|
||||
if (promiseConstructorName.kind === SyntaxKind.Identifier && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {
|
||||
error(returnTypeErrorLocation, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
error(returnTypeErrorLocation, Diagnostics.An_async_function_or_method_in_ES5_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
}
|
||||
else {
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName));
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -41485,11 +41477,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (globalPromiseConstructorLikeType === emptyObjectType) {
|
||||
// If we couldn't resolve the global PromiseConstructorLike type we cannot verify
|
||||
// compatibility with __awaiter.
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName));
|
||||
reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName));
|
||||
return;
|
||||
}
|
||||
|
||||
const headMessage = Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;
|
||||
const headMessage = Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_because_it_does_not_refer_to_a_Promise_compatible_constructor_value;
|
||||
const errorInfo = () => returnTypeNode === returnTypeErrorLocation ? undefined : chainDiagnosticMessages(/*details*/ undefined, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
|
||||
if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeErrorLocation, headMessage, errorInfo)) {
|
||||
return;
|
||||
@@ -43265,7 +43257,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
let arrayType = inputType;
|
||||
let reportedError = false;
|
||||
let hasStringConstituent = false;
|
||||
|
||||
// If strings are permitted, remove any string-like constituents from the array type.
|
||||
@@ -43287,13 +43278,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
hasStringConstituent = arrayType !== inputType;
|
||||
if (hasStringConstituent) {
|
||||
if (languageVersion < ScriptTarget.ES5) {
|
||||
if (errorNode) {
|
||||
error(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher);
|
||||
reportedError = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we've removed all the StringLike types, if no constituents remain, then the entire
|
||||
// arrayOrStringType was a string.
|
||||
if (arrayType.flags & TypeFlags.Never) {
|
||||
@@ -43303,7 +43287,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
if (!isArrayLikeType(arrayType)) {
|
||||
if (errorNode && !reportedError) {
|
||||
if (errorNode) {
|
||||
// Which error we report depends on whether we allow strings or if there was a
|
||||
// string constituent. For example, if the input type is number | string, we
|
||||
// want to say that number is not an array type. But if the input was just
|
||||
@@ -46198,10 +46182,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers);
|
||||
}
|
||||
|
||||
if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === ScriptTarget.ES3) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.CreateBinding);
|
||||
}
|
||||
|
||||
checkGrammarExportDeclaration(node);
|
||||
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
|
||||
if (node.exportClause && !isNamespaceExport(node.exportClause)) {
|
||||
@@ -49039,8 +49019,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return ["__classPrivateFieldSet"];
|
||||
case ExternalEmitHelpers.ClassPrivateFieldIn:
|
||||
return ["__classPrivateFieldIn"];
|
||||
case ExternalEmitHelpers.CreateBinding:
|
||||
return ["__createBinding"];
|
||||
case ExternalEmitHelpers.SetFunctionName:
|
||||
return ["__setFunctionName"];
|
||||
case ExternalEmitHelpers.PropKey:
|
||||
@@ -50122,9 +50100,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
function checkGrammarAccessor(accessor: AccessorDeclaration): boolean {
|
||||
if (!(accessor.flags & NodeFlags.Ambient) && (accessor.parent.kind !== SyntaxKind.TypeLiteral) && (accessor.parent.kind !== SyntaxKind.InterfaceDeclaration)) {
|
||||
if (languageVersion < ScriptTarget.ES5) {
|
||||
return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);
|
||||
}
|
||||
if (languageVersion < ScriptTarget.ES2015 && isPrivateIdentifier(accessor.name)) {
|
||||
return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
"category": "Error",
|
||||
"code": 1054
|
||||
},
|
||||
"Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.": {
|
||||
"Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.": {
|
||||
"category": "Error",
|
||||
"code": 1055
|
||||
},
|
||||
@@ -799,15 +799,15 @@
|
||||
"category": "Error",
|
||||
"code": 1249
|
||||
},
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.": {
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.": {
|
||||
"category": "Error",
|
||||
"code": 1250
|
||||
},
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.": {
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode.": {
|
||||
"category": "Error",
|
||||
"code": 1251
|
||||
},
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.": {
|
||||
"Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode.": {
|
||||
"category": "Error",
|
||||
"code": 1252
|
||||
},
|
||||
@@ -2420,7 +2420,7 @@
|
||||
"category": "Error",
|
||||
"code": 2495
|
||||
},
|
||||
"The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.": {
|
||||
"The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.": {
|
||||
"category": "Error",
|
||||
"code": 2496
|
||||
},
|
||||
@@ -2520,7 +2520,7 @@
|
||||
"category": "Error",
|
||||
"code": 2520
|
||||
},
|
||||
"The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.": {
|
||||
"The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method.": {
|
||||
"category": "Error",
|
||||
"code": 2522
|
||||
},
|
||||
@@ -3135,7 +3135,7 @@
|
||||
"category": "Error",
|
||||
"code": 2704
|
||||
},
|
||||
"An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.": {
|
||||
"An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.": {
|
||||
"category": "Error",
|
||||
"code": 2705
|
||||
},
|
||||
@@ -3163,7 +3163,7 @@
|
||||
"category": "Error",
|
||||
"code": 2711
|
||||
},
|
||||
"A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.": {
|
||||
"A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.": {
|
||||
"category": "Error",
|
||||
"code": 2712
|
||||
},
|
||||
@@ -4229,10 +4229,6 @@
|
||||
"category": "Error",
|
||||
"code": 5047
|
||||
},
|
||||
"Option '{0}' cannot be specified when option 'target' is 'ES3'.": {
|
||||
"category": "Error",
|
||||
"code": 5048
|
||||
},
|
||||
"Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": {
|
||||
"category": "Error",
|
||||
"code": 5051
|
||||
@@ -5065,7 +5061,7 @@
|
||||
"category": "Message",
|
||||
"code": 6171
|
||||
},
|
||||
"Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'.": {
|
||||
"Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5'.": {
|
||||
"category": "Message",
|
||||
"code": 6179
|
||||
},
|
||||
|
||||
@@ -129,7 +129,6 @@ export interface EmitHelperFactory {
|
||||
// ES2015 Generator Helpers
|
||||
createGeneratorHelper(body: FunctionExpression): Expression;
|
||||
// ES Module Helpers
|
||||
createCreateBindingHelper(module: Expression, inputName: Expression, outputName: Expression | undefined): Expression;
|
||||
createImportStarHelper(expression: Expression): Expression;
|
||||
createImportStarCallbackHelper(): Expression;
|
||||
createImportDefaultHelper(expression: Expression): Expression;
|
||||
@@ -180,7 +179,6 @@ export function createEmitHelperFactory(context: TransformationContext): EmitHel
|
||||
// ES2015 Generator Helpers
|
||||
createGeneratorHelper,
|
||||
// ES Module Helpers
|
||||
createCreateBindingHelper,
|
||||
createImportStarHelper,
|
||||
createImportStarCallbackHelper,
|
||||
createImportDefaultHelper,
|
||||
@@ -608,15 +606,6 @@ export function createEmitHelperFactory(context: TransformationContext): EmitHel
|
||||
|
||||
// ES Module Helpers
|
||||
|
||||
function createCreateBindingHelper(module: Expression, inputName: Expression, outputName: Expression | undefined) {
|
||||
context.requestEmitHelper(createBindingHelper);
|
||||
return factory.createCallExpression(
|
||||
getUnscopedHelperName("__createBinding"),
|
||||
/*typeArguments*/ undefined,
|
||||
[factory.createIdentifier("exports"), module, inputName, ...(outputName ? [outputName] : [])],
|
||||
);
|
||||
}
|
||||
|
||||
function createImportStarHelper(expression: Expression) {
|
||||
context.requestEmitHelper(importStarHelper);
|
||||
return factory.createCallExpression(
|
||||
|
||||
@@ -6042,7 +6042,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
|
||||
node.path = "" as Path;
|
||||
node.resolvedPath = "" as Path;
|
||||
node.originalFileName = "";
|
||||
node.languageVersion = 0;
|
||||
node.languageVersion = ScriptTarget.ES5;
|
||||
node.languageVariant = 0;
|
||||
node.scriptKind = 0;
|
||||
node.isDeclarationFile = false;
|
||||
|
||||
@@ -4366,10 +4366,6 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
|
||||
}
|
||||
}
|
||||
|
||||
if (options.useDefineForClassFields && languageVersion === ScriptTarget.ES3) {
|
||||
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields");
|
||||
}
|
||||
|
||||
if (options.checkJs && !getAllowJSCompilerOption(options)) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs"));
|
||||
}
|
||||
|
||||
+2
-29
@@ -274,31 +274,6 @@ const textToToken = new Map(Object.entries({
|
||||
"`": SyntaxKind.BacktickToken,
|
||||
}));
|
||||
|
||||
/*
|
||||
As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers
|
||||
IdentifierStart ::
|
||||
Can contain Unicode 3.0.0 categories:
|
||||
Uppercase letter (Lu),
|
||||
Lowercase letter (Ll),
|
||||
Titlecase letter (Lt),
|
||||
Modifier letter (Lm),
|
||||
Other letter (Lo), or
|
||||
Letter number (Nl).
|
||||
IdentifierPart :: =
|
||||
Can contain IdentifierStart + Unicode 3.0.0 categories:
|
||||
Non-spacing mark (Mn),
|
||||
Combining spacing mark (Mc),
|
||||
Decimal number (Nd), or
|
||||
Connector punctuation (Pc).
|
||||
|
||||
Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at:
|
||||
http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt
|
||||
*/
|
||||
// dprint-ignore
|
||||
const unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500 ];
|
||||
// dprint-ignore
|
||||
const unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500 ];
|
||||
|
||||
/*
|
||||
As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers
|
||||
IdentifierStart ::
|
||||
@@ -382,15 +357,13 @@ function lookupInUnicodeMap(code: number, map: readonly number[]): boolean {
|
||||
/** @internal */ export function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget | undefined) {
|
||||
return languageVersion! >= ScriptTarget.ES2015 ?
|
||||
lookupInUnicodeMap(code, unicodeESNextIdentifierStart) :
|
||||
languageVersion === ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) :
|
||||
lookupInUnicodeMap(code, unicodeES3IdentifierStart);
|
||||
lookupInUnicodeMap(code, unicodeES5IdentifierStart);
|
||||
}
|
||||
|
||||
function isUnicodeIdentifierPart(code: number, languageVersion: ScriptTarget | undefined) {
|
||||
return languageVersion! >= ScriptTarget.ES2015 ?
|
||||
lookupInUnicodeMap(code, unicodeESNextIdentifierPart) :
|
||||
languageVersion === ScriptTarget.ES5 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) :
|
||||
lookupInUnicodeMap(code, unicodeES3IdentifierPart);
|
||||
lookupInUnicodeMap(code, unicodeES5IdentifierPart);
|
||||
}
|
||||
|
||||
function makeReverseMap(source: Map<string, number>): string[] {
|
||||
|
||||
@@ -55,7 +55,6 @@ import {
|
||||
transformECMAScriptModule,
|
||||
Transformer,
|
||||
TransformerFactory,
|
||||
transformES5,
|
||||
transformES2015,
|
||||
transformES2016,
|
||||
transformES2017,
|
||||
@@ -178,12 +177,6 @@ function getScriptTransformers(compilerOptions: CompilerOptions, customTransform
|
||||
|
||||
transformers.push(getModuleTransformer(moduleKind));
|
||||
|
||||
// The ES5 transformer is last so that it can substitute expressions like `exports.default`
|
||||
// for ES3.
|
||||
if (languageVersion < ScriptTarget.ES5) {
|
||||
transformers.push(transformES5);
|
||||
}
|
||||
|
||||
addRange(transformers, customTransformers && map(customTransformers.after, wrapScriptTransformerFactory));
|
||||
return transformers;
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
import {
|
||||
Bundle,
|
||||
chainBundle,
|
||||
EmitHint,
|
||||
Expression,
|
||||
getOriginalNodeId,
|
||||
Identifier,
|
||||
identifierToKeywordKind,
|
||||
isIdentifier,
|
||||
isPrivateIdentifier,
|
||||
isPropertyAccessExpression,
|
||||
isPropertyAssignment,
|
||||
JsxClosingElement,
|
||||
JsxEmit,
|
||||
JsxOpeningElement,
|
||||
JsxSelfClosingElement,
|
||||
Node,
|
||||
PropertyAccessExpression,
|
||||
PropertyAssignment,
|
||||
setTextRange,
|
||||
SourceFile,
|
||||
SyntaxKind,
|
||||
TransformationContext,
|
||||
} from "../_namespaces/ts";
|
||||
|
||||
/**
|
||||
* Transforms ES5 syntax into ES3 syntax.
|
||||
*
|
||||
* @param context Context and state information for the transformation.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function transformES5(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle {
|
||||
const { factory } = context;
|
||||
const compilerOptions = context.getCompilerOptions();
|
||||
|
||||
// enable emit notification only if using --jsx preserve or react-native
|
||||
let previousOnEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void;
|
||||
let noSubstitution: boolean[];
|
||||
if (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) {
|
||||
previousOnEmitNode = context.onEmitNode;
|
||||
context.onEmitNode = onEmitNode;
|
||||
context.enableEmitNotification(SyntaxKind.JsxOpeningElement);
|
||||
context.enableEmitNotification(SyntaxKind.JsxClosingElement);
|
||||
context.enableEmitNotification(SyntaxKind.JsxSelfClosingElement);
|
||||
noSubstitution = [];
|
||||
}
|
||||
|
||||
const previousOnSubstituteNode = context.onSubstituteNode;
|
||||
context.onSubstituteNode = onSubstituteNode;
|
||||
context.enableSubstitution(SyntaxKind.PropertyAccessExpression);
|
||||
context.enableSubstitution(SyntaxKind.PropertyAssignment);
|
||||
return chainBundle(context, transformSourceFile);
|
||||
|
||||
/**
|
||||
* Transforms an ES5 source file to ES3.
|
||||
*
|
||||
* @param node A SourceFile
|
||||
*/
|
||||
function transformSourceFile(node: SourceFile) {
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the printer just before a node is printed.
|
||||
*
|
||||
* @param hint A hint as to the intended usage of the node.
|
||||
* @param node The node to emit.
|
||||
* @param emitCallback A callback used to emit the node.
|
||||
*/
|
||||
function onEmitNode(hint: EmitHint, node: Node, emitCallback: (emitContext: EmitHint, node: Node) => void) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.JsxOpeningElement:
|
||||
case SyntaxKind.JsxClosingElement:
|
||||
case SyntaxKind.JsxSelfClosingElement:
|
||||
const tagName = (node as JsxOpeningElement | JsxClosingElement | JsxSelfClosingElement).tagName;
|
||||
noSubstitution[getOriginalNodeId(tagName)] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
previousOnEmitNode(hint, node, emitCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hooks node substitutions.
|
||||
*
|
||||
* @param hint A hint as to the intended usage of the node.
|
||||
* @param node The node to substitute.
|
||||
*/
|
||||
function onSubstituteNode(hint: EmitHint, node: Node) {
|
||||
if (node.id && noSubstitution && noSubstitution[node.id]) {
|
||||
return previousOnSubstituteNode(hint, node);
|
||||
}
|
||||
|
||||
node = previousOnSubstituteNode(hint, node);
|
||||
if (isPropertyAccessExpression(node)) {
|
||||
return substitutePropertyAccessExpression(node);
|
||||
}
|
||||
else if (isPropertyAssignment(node)) {
|
||||
return substitutePropertyAssignment(node);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Substitutes a PropertyAccessExpression whose name is a reserved word.
|
||||
*
|
||||
* @param node A PropertyAccessExpression
|
||||
*/
|
||||
function substitutePropertyAccessExpression(node: PropertyAccessExpression): Expression {
|
||||
if (isPrivateIdentifier(node.name)) {
|
||||
return node;
|
||||
}
|
||||
const literalName = trySubstituteReservedName(node.name);
|
||||
if (literalName) {
|
||||
return setTextRange(factory.createElementAccessExpression(node.expression, literalName), node);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Substitutes a PropertyAssignment whose name is a reserved word.
|
||||
*
|
||||
* @param node A PropertyAssignment
|
||||
*/
|
||||
function substitutePropertyAssignment(node: PropertyAssignment): PropertyAssignment {
|
||||
const literalName = isIdentifier(node.name) && trySubstituteReservedName(node.name);
|
||||
if (literalName) {
|
||||
return factory.updatePropertyAssignment(node, literalName, node.initializer);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* If an identifier name is a reserved word, returns a string literal for the name.
|
||||
*
|
||||
* @param name An Identifier
|
||||
*/
|
||||
function trySubstituteReservedName(name: Identifier) {
|
||||
const token = identifierToKeywordKind(name);
|
||||
if (token !== undefined && token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord) {
|
||||
return setTextRange(factory.createStringLiteralFromNode(name), name);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -641,15 +641,13 @@ export function transformLegacyDecorators(context: TransformationContext): (x: S
|
||||
|
||||
const prefix = getClassMemberPrefix(node, member);
|
||||
const memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !hasSyntacticModifier(member, ModifierFlags.Ambient));
|
||||
const descriptor = languageVersion > ScriptTarget.ES3
|
||||
? isPropertyDeclaration(member) && !hasAccessorModifier(member)
|
||||
// We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
|
||||
// should not invoke `Object.getOwnPropertyDescriptor`.
|
||||
? factory.createVoidZero()
|
||||
// We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly.
|
||||
// We have this extra argument here so that we can inject an explicit property descriptor at a later date.
|
||||
: factory.createNull()
|
||||
: undefined;
|
||||
const descriptor = isPropertyDeclaration(member) && !hasAccessorModifier(member)
|
||||
// We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
|
||||
// should not invoke `Object.getOwnPropertyDescriptor`.
|
||||
? factory.createVoidZero()
|
||||
// We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly.
|
||||
// We have this extra argument here so that we can inject an explicit property descriptor at a later date.
|
||||
: factory.createNull();
|
||||
|
||||
const helper = emitHelpers().createDecorateHelper(
|
||||
decoratorExpressions,
|
||||
|
||||
@@ -1598,39 +1598,24 @@ export function transformModule(context: TransformationContext): (x: SourceFile
|
||||
);
|
||||
}
|
||||
for (const specifier of node.exportClause.elements) {
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
statements.push(
|
||||
setOriginalNode(
|
||||
setTextRange(
|
||||
factory.createExpressionStatement(
|
||||
emitHelpers().createCreateBindingHelper(generatedName, factory.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory.createStringLiteralFromNode(specifier.name) : undefined),
|
||||
),
|
||||
specifier,
|
||||
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) &&
|
||||
!(getInternalEmitFlags(node) & InternalEmitFlags.NeverApplyImportHelper) &&
|
||||
idText(specifier.propertyName || specifier.name) === "default";
|
||||
const exportedValue = factory.createPropertyAccessExpression(
|
||||
exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName,
|
||||
specifier.propertyName || specifier.name,
|
||||
);
|
||||
statements.push(
|
||||
setOriginalNode(
|
||||
setTextRange(
|
||||
factory.createExpressionStatement(
|
||||
createExportExpression(factory.getExportName(specifier), exportedValue, /*location*/ undefined, /*liveBinding*/ true),
|
||||
),
|
||||
specifier,
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) &&
|
||||
!(getInternalEmitFlags(node) & InternalEmitFlags.NeverApplyImportHelper) &&
|
||||
idText(specifier.propertyName || specifier.name) === "default";
|
||||
const exportedValue = factory.createPropertyAccessExpression(
|
||||
exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName,
|
||||
specifier.propertyName || specifier.name,
|
||||
);
|
||||
statements.push(
|
||||
setOriginalNode(
|
||||
setTextRange(
|
||||
factory.createExpressionStatement(
|
||||
createExportExpression(factory.getExportName(specifier), exportedValue, /*location*/ undefined, /*liveBinding*/ true),
|
||||
),
|
||||
specifier,
|
||||
),
|
||||
specifier,
|
||||
),
|
||||
);
|
||||
}
|
||||
specifier,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return singleOrMany(statements);
|
||||
@@ -2085,30 +2070,19 @@ export function transformModule(context: TransformationContext): (x: SourceFile
|
||||
}
|
||||
|
||||
function createUnderscoreUnderscoreESModule() {
|
||||
let statement: Statement;
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
statement = factory.createExpressionStatement(
|
||||
createExportExpression(
|
||||
factory.createIdentifier("__esModule"),
|
||||
factory.createTrue(),
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
statement = factory.createExpressionStatement(
|
||||
factory.createCallExpression(
|
||||
factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"),
|
||||
/*typeArguments*/ undefined,
|
||||
[
|
||||
factory.createIdentifier("exports"),
|
||||
factory.createStringLiteral("__esModule"),
|
||||
factory.createObjectLiteralExpression([
|
||||
factory.createPropertyAssignment("value", factory.createTrue()),
|
||||
]),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
const statement = factory.createExpressionStatement(
|
||||
factory.createCallExpression(
|
||||
factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"),
|
||||
/*typeArguments*/ undefined,
|
||||
[
|
||||
factory.createIdentifier("exports"),
|
||||
factory.createStringLiteral("__esModule"),
|
||||
factory.createObjectLiteralExpression([
|
||||
factory.createPropertyAssignment("value", factory.createTrue()),
|
||||
]),
|
||||
],
|
||||
),
|
||||
);
|
||||
setEmitFlags(statement, EmitFlags.CustomPrologue);
|
||||
return statement;
|
||||
}
|
||||
@@ -2140,7 +2114,7 @@ export function transformModule(context: TransformationContext): (x: SourceFile
|
||||
*/
|
||||
function createExportExpression(name: Identifier, value: Expression, location?: TextRange, liveBinding?: boolean) {
|
||||
return setTextRange(
|
||||
liveBinding && languageVersion !== ScriptTarget.ES3 ? factory.createCallExpression(
|
||||
liveBinding ? factory.createCallExpression(
|
||||
factory.createPropertyAccessExpression(
|
||||
factory.createIdentifier("Object"),
|
||||
"defineProperty",
|
||||
|
||||
@@ -7365,6 +7365,7 @@ export const enum ScriptKind {
|
||||
}
|
||||
|
||||
export const enum ScriptTarget {
|
||||
/** @deprecated */
|
||||
ES3 = 0,
|
||||
ES5 = 1,
|
||||
ES2015 = 2,
|
||||
@@ -8152,10 +8153,9 @@ export const enum ExternalEmitHelpers {
|
||||
ClassPrivateFieldGet = 1 << 19, // __classPrivateFieldGet (used by the class private field transformation)
|
||||
ClassPrivateFieldSet = 1 << 20, // __classPrivateFieldSet (used by the class private field transformation)
|
||||
ClassPrivateFieldIn = 1 << 21, // __classPrivateFieldIn (used by the class private field transformation)
|
||||
CreateBinding = 1 << 22, // __createBinding (use by the module transform for (re)exports and namespace imports)
|
||||
SetFunctionName = 1 << 23, // __setFunctionName (used by class fields and ECMAScript decorators)
|
||||
PropKey = 1 << 24, // __propKey (used by class fields and ECMAScript decorators)
|
||||
AddDisposableResourceAndDisposeResources = 1 << 25, // __addDisposableResource and __disposeResources (used by ESNext transformations)
|
||||
SetFunctionName = 1 << 22, // __setFunctionName (used by class fields and ECMAScript decorators)
|
||||
PropKey = 1 << 23, // __propKey (used by class fields and ECMAScript decorators)
|
||||
AddDisposableResourceAndDisposeResources = 1 << 24, // __addDisposableResource and __disposeResources (used by ESNext transformations)
|
||||
|
||||
FirstEmitHelper = Extends,
|
||||
LastEmitHelper = AddDisposableResourceAndDisposeResources,
|
||||
|
||||
@@ -8622,7 +8622,8 @@ export const computedOptions = createComputedCompilerOptions({
|
||||
target: {
|
||||
dependencies: ["module"],
|
||||
computeValue: compilerOptions => {
|
||||
return compilerOptions.target ??
|
||||
const target = compilerOptions.target === ScriptTarget.ES3 ? undefined : compilerOptions.target;
|
||||
return target ??
|
||||
((compilerOptions.module === ModuleKind.Node16 && ScriptTarget.ES2022) ||
|
||||
(compilerOptions.module === ModuleKind.NodeNext && ScriptTarget.ESNext) ||
|
||||
ScriptTarget.ES5);
|
||||
|
||||
@@ -3772,6 +3772,7 @@ export const enum NewLineKind {
|
||||
}
|
||||
|
||||
export const enum ScriptTarget {
|
||||
/** @deprecated */
|
||||
ES3 = "ES3",
|
||||
ES5 = "ES5",
|
||||
ES6 = "ES6",
|
||||
|
||||
@@ -24,7 +24,7 @@ describe("unittests:: services:: DocumentRegistry", () => {
|
||||
assert(f1 === f2, "Expected to have the same document instance");
|
||||
|
||||
// change value of compilation setting that is used during production of AST - new document is required
|
||||
compilerOptions.target = ts.ScriptTarget.ES3;
|
||||
compilerOptions.target = ts.ScriptTarget.ESNext;
|
||||
const f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), /* version */ "1");
|
||||
|
||||
assert(f1 !== f3, "Changed target: Expected to have different instances of document");
|
||||
|
||||
@@ -20,7 +20,7 @@ describe("unittests:: services:: Transpile", () => {
|
||||
transpileOptions.compilerOptions = {};
|
||||
}
|
||||
if (transpileOptions.compilerOptions.target === undefined) {
|
||||
transpileOptions.compilerOptions.target = ts.ScriptTarget.ES3;
|
||||
transpileOptions.compilerOptions.target = ts.ScriptTarget.ES5;
|
||||
}
|
||||
|
||||
if (transpileOptions.compilerOptions.newLine === undefined) {
|
||||
|
||||
@@ -592,13 +592,13 @@ module MyModule {
|
||||
// https://github.com/Microsoft/TypeScript/issues/24709
|
||||
testBaseline("issue24709", () => {
|
||||
const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ true);
|
||||
const transformed = ts.transform(ts.createSourceFile("source.ts", "class X { echo(x: string) { return x; } }", ts.ScriptTarget.ES3), [transformSourceFile]);
|
||||
const transformed = ts.transform(ts.createSourceFile("source.ts", "class X { echo(x: string) { return x; } }", ts.ScriptTarget.ES5), [transformSourceFile]);
|
||||
const transformedSourceFile = transformed.transformed[0];
|
||||
transformed.dispose();
|
||||
const host = new fakes.CompilerHost(fs);
|
||||
host.getSourceFile = () => transformedSourceFile;
|
||||
const program = ts.createProgram(["source.ts"], {
|
||||
target: ts.ScriptTarget.ES3,
|
||||
target: ts.ScriptTarget.ES5,
|
||||
module: ts.ModuleKind.None,
|
||||
noLib: true,
|
||||
}, host);
|
||||
|
||||
@@ -282,7 +282,7 @@ describe("unittests:: tsbuild:: on 'sample1' project", () => {
|
||||
fs: () => projFs,
|
||||
commandLineArgs: ["--b", "tests", "--verbose"],
|
||||
modifyFs: fs => {
|
||||
fs.writeFileSync("tests/tsconfig.base.json", jsonToReadableText({ compilerOptions: { target: "es3" } }));
|
||||
fs.writeFileSync("tests/tsconfig.base.json", jsonToReadableText({ compilerOptions: { target: "es5" } }));
|
||||
replaceText(fs, "tests/tsconfig.json", `"references": [`, `"extends": "./tsconfig.base.json", "references": [`);
|
||||
},
|
||||
edits: [{
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
ES3For-ofTypeCheck1.ts(1,15): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== ES3For-ofTypeCheck1.ts (1 errors) ====
|
||||
for (var v of "") { }
|
||||
~~
|
||||
!!! error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
|
||||
==== ES3For-ofTypeCheck1.ts (0 errors) ====
|
||||
for (var v of "") { }
|
||||
@@ -1,10 +1,7 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
ES3For-ofTypeCheck4.ts(2,17): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== ES3For-ofTypeCheck4.ts (1 errors) ====
|
||||
==== ES3For-ofTypeCheck4.ts (0 errors) ====
|
||||
var union: string | string[];
|
||||
for (const v of union) { }
|
||||
~~~~~
|
||||
!!! error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
|
||||
for (const v of union) { }
|
||||
@@ -1,37 +1,25 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
accessorWithES3.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
accessorWithES3.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
accessorWithES3.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
accessorWithES3.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== accessorWithES3.ts (4 errors) ====
|
||||
==== accessorWithES3.ts (0 errors) ====
|
||||
// error to use accessors in ES3 mode
|
||||
|
||||
class C {
|
||||
get x() {
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
class D {
|
||||
set x(v) {
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
}
|
||||
}
|
||||
|
||||
var x = {
|
||||
get a() { return 1 }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
}
|
||||
|
||||
var y = {
|
||||
set b(v) { }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
accessorsNotAllowedInES3.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
accessorsNotAllowedInES3.ts(4,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== accessorsNotAllowedInES3.ts (2 errors) ====
|
||||
==== accessorsNotAllowedInES3.ts (0 errors) ====
|
||||
class C {
|
||||
get x(): number { return 1; }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
}
|
||||
var y = { get foo() { return 3; } };
|
||||
~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -3054,6 +3054,7 @@ declare namespace ts {
|
||||
Lf = "Lf",
|
||||
}
|
||||
enum ScriptTarget {
|
||||
/** @deprecated */
|
||||
ES3 = "ES3",
|
||||
ES5 = "ES5",
|
||||
ES6 = "ES6",
|
||||
@@ -7695,6 +7696,7 @@ declare namespace ts {
|
||||
Deferred = 7,
|
||||
}
|
||||
enum ScriptTarget {
|
||||
/** @deprecated */
|
||||
ES3 = 0,
|
||||
ES5 = 1,
|
||||
ES2015 = 2,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
asyncAliasReturnType_es5.ts(3,21): error TS1055: Type 'PromiseAlias' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncAliasReturnType_es5.ts(3,21): error TS1055: Type 'PromiseAlias' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
|
||||
|
||||
==== asyncAliasReturnType_es5.ts (1 errors) ====
|
||||
@@ -6,5 +6,5 @@ asyncAliasReturnType_es5.ts(3,21): error TS1055: Type 'PromiseAlias' is not a va
|
||||
|
||||
async function f(): PromiseAlias<void> {
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1055: Type 'PromiseAlias' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'PromiseAlias' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== asyncArrowFunctionCapturesArguments_es5.ts (1 errors) ====
|
||||
@@ -7,7 +7,7 @@ asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2496: The 'arguments'
|
||||
function other() {}
|
||||
var fn = async () => await other.apply(this, arguments);
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
asyncFunctionDeclaration15_es5.ts(6,23): error TS1055: Type '{}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(6,23): error TS1055: Type '{}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(6,23): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
asyncFunctionDeclaration15_es5.ts(7,23): error TS1055: Type 'any' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(8,23): error TS1055: Type 'number' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(7,23): error TS1055: Type 'any' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(8,23): error TS1055: Type 'number' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(8,23): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
asyncFunctionDeclaration15_es5.ts(9,23): error TS1055: Type 'PromiseLike' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(9,23): error TS1055: Type 'PromiseLike' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
|
||||
The types returned by 'then(...)' are incompatible between these types.
|
||||
Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
|
||||
@@ -20,23 +20,23 @@ asyncFunctionDeclaration15_es5.ts(23,25): error TS1320: Type of 'await' operand
|
||||
async function fn1() { } // valid: Promise<void>
|
||||
async function fn2(): { } { } // error
|
||||
~~~
|
||||
!!! error TS1055: Type '{}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type '{}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
~~~
|
||||
!!! error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
async function fn3(): any { } // error
|
||||
~~~
|
||||
!!! error TS1055: Type 'any' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'any' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
async function fn4(): number { } // error
|
||||
~~~~~~
|
||||
!!! error TS1055: Type 'number' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'number' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
~~~~~~
|
||||
!!! error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
async function fn5(): PromiseLike<void> { } // error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1055: Type 'PromiseLike' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'PromiseLike' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
async function fn6(): Thenable { } // error
|
||||
~~~~~~~~
|
||||
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
|
||||
!!! error TS1055: The types returned by 'then(...)' are incompatible between these types.
|
||||
!!! error TS1055: Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/a.js(21,14): error TS1055: Type 'string' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
/a.js(21,14): error TS1055: Type 'string' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
/a.js(27,12): error TS1065: The return type of an async function or method must be the global Promise<T> type.
|
||||
/a.js(45,12): error TS1065: The return type of an async function or method must be the global Promise<T> type.
|
||||
Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
Type 'typeof Thenable' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
|
||||
The types returned by 'then(...)' are incompatible between these types.
|
||||
Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
|
||||
@@ -33,7 +33,7 @@
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
~~~~~~
|
||||
!!! error TS1055: Type 'string' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1055: Type 'string' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
*/
|
||||
const f1 = async str => {
|
||||
return str;
|
||||
@@ -42,7 +42,7 @@
|
||||
/** @type {T1} */
|
||||
~~
|
||||
!!! error TS1065: The return type of an async function or method must be the global Promise<T> type.
|
||||
!!! related TS1055 /a.js:4:14: Type 'string' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! related TS1055 /a.js:4:14: Type 'string' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
const f2 = async str => {
|
||||
return str;
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
/** @type {T3} */
|
||||
~~
|
||||
!!! error TS1065: The return type of an async function or method must be the global Promise<T> type.
|
||||
!!! error TS1065: Type 'typeof Thenable' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1065: Type 'typeof Thenable' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! error TS1065: Construct signature return types 'Thenable' and 'PromiseLike<T>' are incompatible.
|
||||
!!! error TS1065: The types returned by 'then(...)' are incompatible between these types.
|
||||
!!! error TS1065: Type 'void' is not assignable to type 'PromiseLike<TResult1 | TResult2>'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
|
||||
asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method.
|
||||
|
||||
|
||||
==== asyncFunctionDeclarationCapturesArguments_es5.ts (1 errors) ====
|
||||
@@ -8,7 +8,7 @@ asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2522: The 'argum
|
||||
async function fn () {
|
||||
await other.apply(this, arguments);
|
||||
~~~~~~~~~
|
||||
!!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
|
||||
!!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
asyncFunctionNoReturnType.ts(1,1): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
asyncFunctionNoReturnType.ts(1,1): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
==== asyncFunctionNoReturnType.ts (1 errors) ====
|
||||
async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
if (window)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
asyncFunctionReturnExpressionErrorSpans.ts(11,28): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
asyncFunctionReturnExpressionErrorSpans.ts(11,28): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
asyncFunctionReturnExpressionErrorSpans.ts(16,21): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ asyncFunctionReturnExpressionErrorSpans.ts(16,21): error TS2322: Type 'number' i
|
||||
|
||||
async function asyncFoo(): Promise<Foo> {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
return {
|
||||
bar: {
|
||||
baz: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
blockScopedFunctionDeclarationInStrictClass.ts(4,22): error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.
|
||||
blockScopedFunctionDeclarationInStrictClass.ts(4,22): error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode.
|
||||
blockScopedFunctionDeclarationInStrictClass.ts(7,9): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ blockScopedFunctionDeclarationInStrictClass.ts(7,9): error TS2304: Cannot find n
|
||||
if (true) {
|
||||
function foo() { }
|
||||
~~~
|
||||
!!! error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.
|
||||
!!! error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode.
|
||||
foo(); // ok
|
||||
}
|
||||
foo(); // not ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
blockScopedFunctionDeclarationInStrictModule.ts(2,14): error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.
|
||||
blockScopedFunctionDeclarationInStrictModule.ts(2,14): error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode.
|
||||
blockScopedFunctionDeclarationInStrictModule.ts(6,10): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ blockScopedFunctionDeclarationInStrictModule.ts(6,10): error TS2304: Cannot find
|
||||
if (true) {
|
||||
function foo() { }
|
||||
~~~
|
||||
!!! error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.
|
||||
!!! error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode.
|
||||
foo(); // ok
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
blockScopedFunctionDeclarationStrictES5.ts(3,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
blockScopedFunctionDeclarationStrictES5.ts(3,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
blockScopedFunctionDeclarationStrictES5.ts(6,1): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ blockScopedFunctionDeclarationStrictES5.ts(6,1): error TS2304: Cannot find name
|
||||
if (true) {
|
||||
function foo() { } // Error to declare function in block scope
|
||||
~~~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
foo(); // This call should be ok
|
||||
}
|
||||
foo(); // Error to find name foo
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(4,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(4,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(6,13): error TS2554: Expected 0 arguments, but got 1.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(9,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(9,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(11,13): error TS2554: Expected 0 arguments, but got 1.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(14,5): error TS2554: Expected 1 arguments, but got 0.
|
||||
blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2554: Expected 1 arguments, but got 0.
|
||||
@@ -12,7 +12,7 @@ blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2554: Expected
|
||||
if (a === 1) {
|
||||
function foo() { } // Error to declare function in block scope
|
||||
~~~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
foo();
|
||||
foo(10); // not ok
|
||||
~~
|
||||
@@ -21,7 +21,7 @@ blockScopedSameNameFunctionDeclarationStrictES5.ts(17,1): error TS2554: Expected
|
||||
else {
|
||||
function foo() { } // Error to declare function in block scope
|
||||
~~~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
foo();
|
||||
foo(10); // not ok
|
||||
~~
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
/main.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
|
||||
/main.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
|
||||
/mainJs.js(2,1): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
/mainJs.js(2,1): error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
@@ -24,7 +24,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
import {} from "./a";
|
||||
import("./a");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const _ = require("./a");
|
||||
_.a; // any
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
/mainJs.js(2,1): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
/mainJs.js(2,1): error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
@@ -22,7 +22,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
import {} from "./a";
|
||||
import("./a");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const _ = require("./a");
|
||||
_.a; // any
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ classStaticBlock6.ts(32,17): error TS2337: Super calls are not permitted outside
|
||||
classStaticBlock6.ts(41,13): error TS2815: 'arguments' cannot be referenced in property initializers.
|
||||
classStaticBlock6.ts(42,13): error TS18037: 'await' expression cannot be used inside a class static block.
|
||||
classStaticBlock6.ts(42,18): error TS1109: Expression expected.
|
||||
classStaticBlock6.ts(45,17): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
|
||||
classStaticBlock6.ts(45,17): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method.
|
||||
classStaticBlock6.ts(46,22): error TS1109: Expression expected.
|
||||
classStaticBlock6.ts(55,13): error TS2815: 'arguments' cannot be referenced in property initializers.
|
||||
|
||||
@@ -86,7 +86,7 @@ classStaticBlock6.ts(55,13): error TS2815: 'arguments' cannot be referenced in p
|
||||
async function ff () {
|
||||
arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.
|
||||
!!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method.
|
||||
await;
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'.
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'.
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== definePropertyOutputES3.ts (0 errors) ====
|
||||
class A {
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
destructuringControlFlowNoCrash.ts(3,3): error TS2339: Property 'date' does not exist on type '(inspectedElement: any) => number'.
|
||||
destructuringControlFlowNoCrash.ts(10,3): error TS2339: Property 'date2' does not exist on type '(inspectedElement: any) => any'.
|
||||
destructuringControlFlowNoCrash.ts(11,28): error TS1005: '=>' expected.
|
||||
destructuringControlFlowNoCrash.ts(16,25): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
destructuringControlFlowNoCrash.ts(16,25): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
@@ -30,5 +30,5 @@ destructuringControlFlowNoCrash.ts(16,25): error TS2705: An async function or me
|
||||
// It could also be an async function
|
||||
const { constructor } = async () => {};
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
downlevelLetConst18.ts(4,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
downlevelLetConst18.ts(8,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
downlevelLetConst18.ts(4,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
downlevelLetConst18.ts(8,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
|
||||
|
||||
==== downlevelLetConst18.ts (2 errors) ====
|
||||
@@ -8,13 +8,13 @@ downlevelLetConst18.ts(8,14): error TS1250: Function declarations are not allowe
|
||||
for (let x; ;) {
|
||||
function foo() { x };
|
||||
~~~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
function foo1() { x };
|
||||
~~~~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
}
|
||||
|
||||
for (let x; ;) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
downlevelLetConst19.ts(9,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
downlevelLetConst19.ts(9,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
|
||||
|
||||
==== downlevelLetConst19.ts (1 errors) ====
|
||||
@@ -12,7 +12,7 @@ downlevelLetConst19.ts(9,14): error TS1250: Function declarations are not allowe
|
||||
|
||||
function b() {
|
||||
~
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
|
||||
{
|
||||
let x;
|
||||
use(x);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments01.ts (4 errors) ====
|
||||
var a = () => {
|
||||
var arg = arguments[0]; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
|
||||
var b = function () {
|
||||
var a = () => {
|
||||
var arg = arguments[0]; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' o
|
||||
() => {
|
||||
var arg = arguments[0];
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' o
|
||||
foo(() => {
|
||||
var arg = arguments[0]; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
});
|
||||
|
||||
function bar() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
emitArrowFunctionWhenUsingArguments02.ts(1,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments02.ts(1,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments02.ts (1 errors) ====
|
||||
var a = () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
@@ -1,8 +1,8 @@
|
||||
emitArrowFunctionWhenUsingArguments03.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments03.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments03.ts (1 errors) ====
|
||||
var arguments;
|
||||
var a = () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments04.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments04.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments04.ts (1 errors) ====
|
||||
@@ -6,5 +6,5 @@ emitArrowFunctionWhenUsingArguments04.ts(3,19): error TS2496: The 'arguments' ob
|
||||
var arguments;
|
||||
var a = () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
emitArrowFunctionWhenUsingArguments05.ts(2,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments05.ts(2,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments05.ts (1 errors) ====
|
||||
function f(arguments) {
|
||||
var a = () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
emitArrowFunctionWhenUsingArguments06.ts(2,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments06.ts(2,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments06.ts (1 errors) ====
|
||||
function f(arguments) {
|
||||
var a = () => () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
emitArrowFunctionWhenUsingArguments07.ts(2,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments07.ts(2,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments07.ts (1 errors) ====
|
||||
function f(arguments) {
|
||||
var a = (arguments) => () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
emitArrowFunctionWhenUsingArguments09.ts(2,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments09.ts(2,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments09.ts (1 errors) ====
|
||||
function f(_arguments) {
|
||||
var a = () => () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments10.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments10.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments10.ts (1 errors) ====
|
||||
@@ -6,5 +6,5 @@ emitArrowFunctionWhenUsingArguments10.ts(3,25): error TS2496: The 'arguments' ob
|
||||
var _arguments = 10;
|
||||
var a = () => () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments11.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments11.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments11.ts (1 errors) ====
|
||||
@@ -6,5 +6,5 @@ emitArrowFunctionWhenUsingArguments11.ts(3,25): error TS2496: The 'arguments' ob
|
||||
var _arguments = 10;
|
||||
var a = () => () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
emitArrowFunctionWhenUsingArguments12.ts(2,7): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
|
||||
emitArrowFunctionWhenUsingArguments12.ts(3,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments12.ts(3,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments12.ts (2 errors) ====
|
||||
@@ -9,6 +9,6 @@ emitArrowFunctionWhenUsingArguments12.ts(3,23): error TS2496: The 'arguments' ob
|
||||
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
|
||||
var a = () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments14.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments14.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments14.ts (1 errors) ====
|
||||
@@ -7,6 +7,6 @@ emitArrowFunctionWhenUsingArguments14.ts(4,22): error TS2496: The 'arguments' ob
|
||||
const arguments = 100;
|
||||
return () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments15.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments15.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments15.ts (1 errors) ====
|
||||
@@ -8,6 +8,6 @@ emitArrowFunctionWhenUsingArguments15.ts(5,22): error TS2496: The 'arguments' ob
|
||||
const arguments = 100;
|
||||
return () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments16.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments16.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments16.ts (1 errors) ====
|
||||
@@ -7,7 +7,7 @@ emitArrowFunctionWhenUsingArguments16.ts(4,22): error TS2496: The 'arguments' ob
|
||||
if (Math.random()) {
|
||||
return () => arguments[0];
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
var arguments = "world";
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments17.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments17.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments17.ts (1 errors) ====
|
||||
@@ -7,7 +7,7 @@ emitArrowFunctionWhenUsingArguments17.ts(4,22): error TS2496: The 'arguments' ob
|
||||
if (Math.random()) {
|
||||
return () => arguments[0];
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
var arguments = "world";
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments18.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments18.ts(4,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments18.ts (1 errors) ====
|
||||
@@ -7,6 +7,6 @@ emitArrowFunctionWhenUsingArguments18.ts(4,22): error TS2496: The 'arguments' ob
|
||||
if (Math.random()) {
|
||||
return () => arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
emitArrowFunctionWhenUsingArguments19.ts(5,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
emitArrowFunctionWhenUsingArguments19.ts(5,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
|
||||
|
||||
==== emitArrowFunctionWhenUsingArguments19.ts (1 errors) ====
|
||||
@@ -8,7 +8,7 @@ emitArrowFunctionWhenUsingArguments19.ts(5,33): error TS2496: The 'arguments' ob
|
||||
function h() {
|
||||
var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h'
|
||||
~~~~~~~~~
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.
|
||||
!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression.
|
||||
foo(_arguments); // Error as this does not resolve to the user defined '_arguments'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
foo.js(7,10): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
foo.js(11,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
foo.js(11,12): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
foo.js(13,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
foo.js(16,60): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
foo.js(21,20): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.
|
||||
@@ -25,7 +25,7 @@ foo.js(45,18): error TS2534: A function returning 'never' cannot have a reachabl
|
||||
|
||||
/** @type {FunctionReturningPromise} */
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
async function testPromise2() {
|
||||
return "asd";
|
||||
~~~~~~
|
||||
@@ -60,7 +60,7 @@ foo.js(45,18): error TS2534: A function returning 'never' cannot have a reachabl
|
||||
/** @type {FunctionReturningNever} */
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1065: The return type of an async function or method must be the global Promise<T> type.
|
||||
!!! related TS1055 foo.js:27:14: Type 'never' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.
|
||||
!!! related TS1055 foo.js:27:14: Type 'never' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
|
||||
async function testNever2() {
|
||||
return "asd";
|
||||
~~~~~~
|
||||
|
||||
@@ -15,7 +15,7 @@ assert(Foo.CONSTANT === "Foo");
|
||||
|
||||
//// [es3defaultAliasQuoted_file0.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Foo = void 0;
|
||||
var Foo = /** @class */ (function () {
|
||||
function Foo() {
|
||||
@@ -28,9 +28,9 @@ function assert(value) {
|
||||
if (!value)
|
||||
throw new Error("Assertion failed!");
|
||||
}
|
||||
exports["default"] = assert;
|
||||
exports.default = assert;
|
||||
//// [es3defaultAliasQuoted_file1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var es3defaultAliasQuoted_file0_1 = require("./es3defaultAliasQuoted_file0");
|
||||
(0, es3defaultAliasQuoted_file0_1["default"])(es3defaultAliasQuoted_file0_1.Foo.CONSTANT === "Foo");
|
||||
(0, es3defaultAliasQuoted_file0_1.default)(es3defaultAliasQuoted_file0_1.Foo.CONSTANT === "Foo");
|
||||
|
||||
@@ -40,12 +40,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.y = exports.x = void 0;
|
||||
var fs = __importStar(require("./fs"));
|
||||
fs;
|
||||
__exportStar(require("./fs"), exports);
|
||||
var fs_1 = require("./fs");
|
||||
__createBinding(exports, fs_1, "x");
|
||||
Object.defineProperty(exports, "x", { enumerable: true, get: function () { return fs_1.x; } });
|
||||
var fs_2 = require("./fs");
|
||||
__createBinding(exports, fs_2, "x", "y");
|
||||
Object.defineProperty(exports, "y", { enumerable: true, get: function () { return fs_2.x; } });
|
||||
|
||||
@@ -14,17 +14,17 @@ export default function f2() {
|
||||
//// [m1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function f1() {
|
||||
}
|
||||
exports["default"] = f1;
|
||||
exports.default = f1;
|
||||
});
|
||||
//// [m2.js]
|
||||
define(["require", "exports", "./m1"], function (require, exports, m1_1) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function f2() {
|
||||
(0, m1_1["default"])();
|
||||
(0, m1_1.default)();
|
||||
}
|
||||
exports["default"] = f2;
|
||||
exports.default = f2;
|
||||
});
|
||||
|
||||
@@ -13,15 +13,15 @@ export default function f2() {
|
||||
|
||||
//// [m1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function f1() {
|
||||
}
|
||||
exports["default"] = f1;
|
||||
exports.default = f1;
|
||||
//// [m2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var m1_1 = require("./m1");
|
||||
function f2() {
|
||||
(0, m1_1["default"])();
|
||||
(0, m1_1.default)();
|
||||
}
|
||||
exports["default"] = f2;
|
||||
exports.default = f2;
|
||||
|
||||
@@ -15,15 +15,15 @@ const { __, _, ___ } = R;
|
||||
|
||||
//// [m1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var R;
|
||||
exports["default"] = R = {
|
||||
exports.default = R = {
|
||||
"__": 20,
|
||||
"_": 10,
|
||||
"___": 30
|
||||
};
|
||||
//// [m2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var m1_1 = require("./m1");
|
||||
var __ = m1_1["default"].__, _ = m1_1["default"]._, ___ = m1_1["default"].___;
|
||||
var __ = m1_1.default.__, _ = m1_1.default._, ___ = m1_1.default.___;
|
||||
|
||||
@@ -14,14 +14,14 @@ const { __esmodule, __proto__ } = R;
|
||||
|
||||
//// [m1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var R;
|
||||
exports["default"] = R = {
|
||||
exports.default = R = {
|
||||
"__esmodule": true,
|
||||
"__proto__": {}
|
||||
};
|
||||
//// [m2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var m1_1 = require("./m1");
|
||||
var __esmodule = m1_1["default"].__esmodule, __proto__ = m1_1["default"].__proto__;
|
||||
var __esmodule = m1_1.default.__esmodule, __proto__ = m1_1.default.__proto__;
|
||||
|
||||
@@ -15,15 +15,15 @@ const { ___, ___hello, _hi } = R;
|
||||
|
||||
//// [m1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var R;
|
||||
exports["default"] = R = {
|
||||
exports.default = R = {
|
||||
"___": 30,
|
||||
"___hello": 21,
|
||||
"_hi": 40
|
||||
"_hi": 40,
|
||||
};
|
||||
//// [m2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var m1_1 = require("./m1");
|
||||
var ___ = m1_1["default"].___, ___hello = m1_1["default"].___hello, _hi = m1_1["default"]._hi;
|
||||
var ___ = m1_1.default.___, ___hello = m1_1.default.___hello, _hi = m1_1.default._hi;
|
||||
|
||||
@@ -35,7 +35,7 @@ _hi();
|
||||
|
||||
//// [m1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.___hello = exports.__esmodule = exports.__proto = exports._hi = exports.___ = exports.__ = exports._ = void 0;
|
||||
function _() {
|
||||
console.log("_");
|
||||
@@ -67,7 +67,7 @@ function ___hello() {
|
||||
exports.___hello = ___hello;
|
||||
//// [m2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var m1_1 = require("./m1");
|
||||
(0, m1_1._)();
|
||||
(0, m1_1.__)();
|
||||
|
||||
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
};
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.l = exports.cl2 = exports.obj = exports.cl1 = exports.fn = void 0;
|
||||
function fn() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
|
||||
@@ -68,7 +68,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.l = exports.cl2 = exports.obj = exports.cl1 = exports.fn = void 0;
|
||||
function fn() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
|
||||
@@ -76,7 +76,7 @@ System.register([], function (exports_1, context_1) {
|
||||
var req;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, context_1["import"]('./test')]; // ONE
|
||||
case 0: return [4 /*yield*/, context_1.import('./test')]; // ONE
|
||||
case 1:
|
||||
req = _a.sent() // ONE
|
||||
;
|
||||
@@ -97,7 +97,7 @@ System.register([], function (exports_1, context_1) {
|
||||
var req;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, context_1["import"]('./test')]; // TWO
|
||||
case 0: return [4 /*yield*/, context_1.import('./test')]; // TWO
|
||||
case 1:
|
||||
req = _a.sent() // TWO
|
||||
;
|
||||
@@ -114,7 +114,7 @@ System.register([], function (exports_1, context_1) {
|
||||
var req;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, context_1["import"]('./test')]; // THREE
|
||||
case 0: return [4 /*yield*/, context_1.import('./test')]; // THREE
|
||||
case 1:
|
||||
req = _a.sent() // THREE
|
||||
;
|
||||
@@ -131,7 +131,7 @@ System.register([], function (exports_1, context_1) {
|
||||
var req;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, context_1["import"]('./test')]; // FOUR
|
||||
case 0: return [4 /*yield*/, context_1.import('./test')]; // FOUR
|
||||
case 1:
|
||||
req = _a.sent() // FOUR
|
||||
;
|
||||
@@ -148,7 +148,7 @@ System.register([], function (exports_1, context_1) {
|
||||
var req;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, context_1["import"]('./test')]; // FIVE
|
||||
case 0: return [4 /*yield*/, context_1.import('./test')]; // FIVE
|
||||
case 1:
|
||||
req = _a.sent() // FIVE
|
||||
;
|
||||
|
||||
@@ -78,7 +78,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.l = exports.cl2 = exports.obj = exports.cl1 = exports.fn = void 0;
|
||||
function fn() {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
2.ts(3,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(5,27): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(8,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(10,29): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(3,24): error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(5,27): error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(8,12): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
2.ts(10,29): error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
@@ -21,20 +21,20 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2712: A dynamic import call in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is onl
|
||||
assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
@@ -28,7 +28,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
|
||||
@@ -7,7 +7,7 @@ assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is onl
|
||||
assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
@@ -28,7 +28,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'.
|
||||
assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
|
||||
assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
|
||||
moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
|
||||
@@ -15,7 +15,7 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper
|
||||
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
|
||||
(async () => {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
|
||||
const blob = await response.blob();
|
||||
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
objectLiteralErrorsES3.ts(1,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
objectLiteralErrorsES3.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
objectLiteralErrorsES3.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
objectLiteralErrorsES3.ts(3,40): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== objectLiteralErrorsES3.ts (4 errors) ====
|
||||
==== objectLiteralErrorsES3.ts (0 errors) ====
|
||||
var e1 = { get a() { return 4; } };
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
var e2 = { set a(n) { } };
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
var e3 = { get a() { return ''; }, set a(n) { } };
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
operationsAvailableOnPromisedType.ts(1,16): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
operationsAvailableOnPromisedType.ts(1,16): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
operationsAvailableOnPromisedType.ts(11,9): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
|
||||
operationsAvailableOnPromisedType.ts(12,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
|
||||
operationsAvailableOnPromisedType.ts(13,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'Promise<number>'.
|
||||
@@ -27,7 +27,7 @@ operationsAvailableOnPromisedType.ts(27,5): error TS2349: This expression is not
|
||||
==== operationsAvailableOnPromisedType.ts (17 errors) ====
|
||||
async function fn(
|
||||
~~
|
||||
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
!!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
|
||||
a: number,
|
||||
b: Promise<number>,
|
||||
c: Promise<string[]>,
|
||||
|
||||
@@ -3,10 +3,10 @@ privateNameES5Ban.ts(3,5): error TS18028: Private identifiers are only available
|
||||
privateNameES5Ban.ts(4,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(5,12): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(6,12): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
privateNameES5Ban.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
privateNameES5Ban.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
privateNameES5Ban.ts(10,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
privateNameES5Ban.ts(7,9): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(8,9): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(9,16): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
privateNameES5Ban.ts(10,16): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
@@ -27,16 +27,16 @@ privateNameES5Ban.ts(10,16): error TS1056: Accessors are only available when tar
|
||||
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
get #acc() { return ""; }
|
||||
~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
set #acc(x: string) {}
|
||||
~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
static get #sAcc() { return 0; }
|
||||
~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
static set #sAcc(x: number) {}
|
||||
~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ var a6 = [, , ];
|
||||
|
||||
//// [trailingCommasES3.js]
|
||||
var o1 = { a: 1, b: 2 };
|
||||
var o2 = { a: 1, b: 2 };
|
||||
var o3 = { a: 1 };
|
||||
var o2 = { a: 1, b: 2, };
|
||||
var o3 = { a: 1, };
|
||||
var o4 = {};
|
||||
var a1 = [1, 2];
|
||||
var a2 = [1, 2,];
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
import IFoo = Namespace.IFoo;export type { IFoo };
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var IFoo = Namespace.IFoo;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
import IFoo = Namespace.IFoo;export type { IFoo };
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var IFoo = Namespace.IFoo;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
import IFoo = Namespace.IFoo;export { type IFoo };
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var IFoo = Namespace.IFoo;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
import IFoo = Namespace.IFoo;export { type IFoo };
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var IFoo = Namespace.IFoo;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
var x: string = 0;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
var x: string = 0;
|
||||
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
var x: string = 0;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
var x: string = 0;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== input.js (0 errors) ====
|
||||
x;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== input.js (0 errors) ====
|
||||
x;
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
|
||||
|
||||
!!! error TS5108: Option 'target=ES3' has been removed. Please remove it from your configuration.
|
||||
==== file.ts (0 errors) ====
|
||||
import IFoo = Namespace.IFoo;export type { IFoo };
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user