@@ -3225,7 +3225,7 @@ namespace ts {
32253225 const elements = pattern.elements;
32263226 const lastElement = lastOrUndefined(elements);
32273227 if (elements.length === 0 || (!isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
3228- return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType;
3228+ return languageVersion >= ScriptTarget.ES2015 ? createIterableType(anyType) : anyArrayType;
32293229 }
32303230 // If the pattern has at least one element, and no rest element, then it should imply a tuple type.
32313231 const elementTypes = map(elements, e => isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors));
@@ -9286,7 +9286,7 @@ namespace ts {
92869286 // can explicitly bound arguments objects
92879287 if (symbol === argumentsSymbol) {
92889288 const container = getContainingFunction(node);
9289- if (languageVersion < ScriptTarget.ES6 ) {
9289+ if (languageVersion < ScriptTarget.ES2015 ) {
92909290 if (container.kind === SyntaxKind.ArrowFunction) {
92919291 error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
92929292 }
@@ -9311,7 +9311,7 @@ namespace ts {
93119311 // Due to the emit for class decorators, any reference to the class from inside of the class body
93129312 // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
93139313 // behavior of class names in ES6.
9314- if (languageVersion === ScriptTarget.ES6
9314+ if (languageVersion === ScriptTarget.ES2015
93159315 && declaration.kind === SyntaxKind.ClassDeclaration
93169316 && nodeIsDecorated(declaration)) {
93179317 let container = getContainingClass(node);
@@ -9410,7 +9410,7 @@ namespace ts {
94109410 }
94119411
94129412 function checkNestedBlockScopedBinding(node: Identifier, symbol: Symbol): void {
9413- if (languageVersion >= ScriptTarget.ES6 ||
9413+ if (languageVersion >= ScriptTarget.ES2015 ||
94149414 (symbol.flags & (SymbolFlags.BlockScopedVariable | SymbolFlags.Class)) === 0 ||
94159415 symbol.valueDeclaration.parent.kind === SyntaxKind.CatchClause) {
94169416 return;
@@ -9576,7 +9576,7 @@ namespace ts {
95769576 container = getThisContainer(container, /* includeArrowFunctions */ false);
95779577
95789578 // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code
9579- needToCaptureLexicalThis = (languageVersion < ScriptTarget.ES6 );
9579+ needToCaptureLexicalThis = (languageVersion < ScriptTarget.ES2015 );
95809580 }
95819581
95829582 switch (container.kind) {
@@ -9684,7 +9684,7 @@ namespace ts {
96849684 if (!isCallExpression) {
96859685 while (container && container.kind === SyntaxKind.ArrowFunction) {
96869686 container = getSuperContainer(container, /*stopOnFunctions*/ true);
9687- needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6 ;
9687+ needToCaptureLexicalThis = languageVersion < ScriptTarget.ES2015 ;
96889688 }
96899689 }
96909690
@@ -9798,7 +9798,7 @@ namespace ts {
97989798 }
97999799
98009800 if (container.parent.kind === SyntaxKind.ObjectLiteralExpression) {
9801- if (languageVersion < ScriptTarget.ES6 ) {
9801+ if (languageVersion < ScriptTarget.ES2015 ) {
98029802 error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
98039803 return unknownType;
98049804 }
@@ -10166,7 +10166,7 @@ namespace ts {
1016610166 const index = indexOf(arrayLiteral.elements, node);
1016710167 return getTypeOfPropertyOfContextualType(type, "" + index)
1016810168 || getIndexTypeOfContextualType(type, IndexKind.Number)
10169- || (languageVersion >= ScriptTarget.ES6 ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined);
10169+ || (languageVersion >= ScriptTarget.ES2015 ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined);
1017010170 }
1017110171 return undefined;
1017210172 }
@@ -10399,7 +10399,7 @@ namespace ts {
1039910399 // if there is no index type / iterated type.
1040010400 const restArrayType = checkExpression((<SpreadElementExpression>e).expression, contextualMapper);
1040110401 const restElementType = getIndexTypeOfType(restArrayType, IndexKind.Number) ||
10402- (languageVersion >= ScriptTarget.ES6 ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined);
10402+ (languageVersion >= ScriptTarget.ES2015 ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined);
1040310403 if (restElementType) {
1040410404 elementTypes.push(restElementType);
1040510405 }
@@ -11146,7 +11146,7 @@ namespace ts {
1114611146 // - In a static member function or static member accessor
1114711147 // where this references the constructor function object of a derived class,
1114811148 // a super property access is permitted and must specify a public static member function of the base class.
11149- if (languageVersion < ScriptTarget.ES6 && getDeclarationKindFromSymbol(prop) !== SyntaxKind.MethodDeclaration) {
11149+ if (languageVersion < ScriptTarget.ES2015 && getDeclarationKindFromSymbol(prop) !== SyntaxKind.MethodDeclaration) {
1115011150 // `prop` refers to a *property* declared in the super class
1115111151 // rather than a *method*, so it does not satisfy the above criteria.
1115211152
@@ -14468,7 +14468,7 @@ namespace ts {
1446814468 }
1446914469
1447014470 if (node.type) {
14471- if (languageVersion >= ScriptTarget.ES6 && isSyntacticallyValidGenerator(node)) {
14471+ if (languageVersion >= ScriptTarget.ES2015 && isSyntacticallyValidGenerator(node)) {
1447214472 const returnType = getTypeFromTypeNode(node.type);
1447314473 if (returnType === voidType) {
1447414474 error(node.type, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
@@ -15429,7 +15429,7 @@ namespace ts {
1542915429 * callable `then` signature.
1543015430 */
1543115431 function checkAsyncFunctionReturnType(node: FunctionLikeDeclaration): Type {
15432- if (languageVersion >= ScriptTarget.ES6 ) {
15432+ if (languageVersion >= ScriptTarget.ES2015 ) {
1543315433 const returnType = getTypeFromTypeNode(node.type);
1543415434 return checkCorrectPromiseType(returnType, node.type, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
1543515435 }
@@ -15958,7 +15958,7 @@ namespace ts {
1595815958
1595915959 function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) {
1596015960 // No need to check for require or exports for ES6 modules and later
15961- if (modulekind >= ModuleKind.ES6 ) {
15961+ if (modulekind >= ModuleKind.ES2015 ) {
1596215962 return;
1596315963 }
1596415964
@@ -16454,7 +16454,7 @@ namespace ts {
1645416454 if (isTypeAny(inputType)) {
1645516455 return inputType;
1645616456 }
16457- if (languageVersion >= ScriptTarget.ES6 ) {
16457+ if (languageVersion >= ScriptTarget.ES2015 ) {
1645816458 return checkElementTypeOfIterable(inputType, errorNode);
1645916459 }
1646016460 if (allowStringInput) {
@@ -16632,7 +16632,7 @@ namespace ts {
1663216632 * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable).
1663316633 */
1663416634 function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type {
16635- Debug.assert(languageVersion < ScriptTarget.ES6 );
16635+ Debug.assert(languageVersion < ScriptTarget.ES2015 );
1663616636
1663716637 // After we remove all types that are StringLike, we will know if there was a string constituent
1663816638 // based on whether the remaining type is the same as the initial type.
@@ -17943,7 +17943,7 @@ namespace ts {
1794317943 }
1794417944 }
1794517945 else {
17946- if (modulekind === ModuleKind.ES6 && !isInAmbientContext(node)) {
17946+ if (modulekind === ModuleKind.ES2015 && !isInAmbientContext(node)) {
1794717947 // Import equals declaration is deprecated in es6 or above
1794817948 grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
1794917949 }
@@ -18031,7 +18031,7 @@ namespace ts {
1803118031 checkExternalModuleExports(container);
1803218032
1803318033 if (node.isExportEquals && !isInAmbientContext(node)) {
18034- if (modulekind === ModuleKind.ES6 ) {
18034+ if (modulekind === ModuleKind.ES2015 ) {
1803518035 // export assignment is not supported in es6 modules
1803618036 grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead);
1803718037 }
@@ -19543,7 +19543,7 @@ namespace ts {
1954319543
1954419544 getGlobalTemplateStringsArrayType = memoize(() => getGlobalType("TemplateStringsArray"));
1954519545
19546- if (languageVersion >= ScriptTarget.ES6 ) {
19546+ if (languageVersion >= ScriptTarget.ES2015 ) {
1954719547 getGlobalESSymbolType = memoize(() => getGlobalType("Symbol"));
1954819548 getGlobalIterableType = memoize(() => <GenericType>getGlobalType("Iterable", /*arity*/ 1));
1954919549 getGlobalIteratorType = memoize(() => <GenericType>getGlobalType("Iterator", /*arity*/ 1));
@@ -19577,7 +19577,7 @@ namespace ts {
1957719577 // If we found the module, report errors if it does not have the necessary exports.
1957819578 if (helpersModule) {
1957919579 const exports = helpersModule.exports;
19580- if (requestedExternalEmitHelpers & NodeFlags.HasClassExtends && languageVersion < ScriptTarget.ES6 ) {
19580+ if (requestedExternalEmitHelpers & NodeFlags.HasClassExtends && languageVersion < ScriptTarget.ES2015 ) {
1958119581 verifyHelperSymbol(exports, "__extends", SymbolFlags.Value);
1958219582 }
1958319583 if (requestedExternalEmitHelpers & NodeFlags.HasJsxSpreadAttributes && compilerOptions.jsx !== JsxEmit.Preserve) {
@@ -19594,7 +19594,7 @@ namespace ts {
1959419594 }
1959519595 if (requestedExternalEmitHelpers & NodeFlags.HasAsyncFunctions) {
1959619596 verifyHelperSymbol(exports, "__awaiter", SymbolFlags.Value);
19597- if (languageVersion < ScriptTarget.ES6 ) {
19597+ if (languageVersion < ScriptTarget.ES2015 ) {
1959819598 verifyHelperSymbol(exports, "__generator", SymbolFlags.Value);
1959919599 }
1960019600 }
@@ -20171,7 +20171,7 @@ namespace ts {
2017120171 if (!node.body) {
2017220172 return grammarErrorOnNode(node.asteriskToken, Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator);
2017320173 }
20174- if (languageVersion < ScriptTarget.ES6 ) {
20174+ if (languageVersion < ScriptTarget.ES2015 ) {
2017520175 return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher);
2017620176 }
2017720177 }
0 commit comments