@@ -3225,7 +3225,7 @@ namespace ts {
3225
3225
const elements = pattern.elements;
3226
3226
const lastElement = lastOrUndefined(elements);
3227
3227
if (elements.length === 0 || (!isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
3228
- return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType;
3228
+ return languageVersion >= ScriptTarget.ES2015 ? createIterableType(anyType) : anyArrayType;
3229
3229
}
3230
3230
// If the pattern has at least one element, and no rest element, then it should imply a tuple type.
3231
3231
const elementTypes = map(elements, e => isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors));
@@ -9286,7 +9286,7 @@ namespace ts {
9286
9286
// can explicitly bound arguments objects
9287
9287
if (symbol === argumentsSymbol) {
9288
9288
const container = getContainingFunction(node);
9289
- if (languageVersion < ScriptTarget.ES6 ) {
9289
+ if (languageVersion < ScriptTarget.ES2015 ) {
9290
9290
if (container.kind === SyntaxKind.ArrowFunction) {
9291
9291
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
9292
9292
}
@@ -9311,7 +9311,7 @@ namespace ts {
9311
9311
// Due to the emit for class decorators, any reference to the class from inside of the class body
9312
9312
// must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
9313
9313
// behavior of class names in ES6.
9314
- if (languageVersion === ScriptTarget.ES6
9314
+ if (languageVersion === ScriptTarget.ES2015
9315
9315
&& declaration.kind === SyntaxKind.ClassDeclaration
9316
9316
&& nodeIsDecorated(declaration)) {
9317
9317
let container = getContainingClass(node);
@@ -9410,7 +9410,7 @@ namespace ts {
9410
9410
}
9411
9411
9412
9412
function checkNestedBlockScopedBinding(node: Identifier, symbol: Symbol): void {
9413
- if (languageVersion >= ScriptTarget.ES6 ||
9413
+ if (languageVersion >= ScriptTarget.ES2015 ||
9414
9414
(symbol.flags & (SymbolFlags.BlockScopedVariable | SymbolFlags.Class)) === 0 ||
9415
9415
symbol.valueDeclaration.parent.kind === SyntaxKind.CatchClause) {
9416
9416
return;
@@ -9576,7 +9576,7 @@ namespace ts {
9576
9576
container = getThisContainer(container, /* includeArrowFunctions */ false);
9577
9577
9578
9578
// 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 );
9580
9580
}
9581
9581
9582
9582
switch (container.kind) {
@@ -9684,7 +9684,7 @@ namespace ts {
9684
9684
if (!isCallExpression) {
9685
9685
while (container && container.kind === SyntaxKind.ArrowFunction) {
9686
9686
container = getSuperContainer(container, /*stopOnFunctions*/ true);
9687
- needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6 ;
9687
+ needToCaptureLexicalThis = languageVersion < ScriptTarget.ES2015 ;
9688
9688
}
9689
9689
}
9690
9690
@@ -9798,7 +9798,7 @@ namespace ts {
9798
9798
}
9799
9799
9800
9800
if (container.parent.kind === SyntaxKind.ObjectLiteralExpression) {
9801
- if (languageVersion < ScriptTarget.ES6 ) {
9801
+ if (languageVersion < ScriptTarget.ES2015 ) {
9802
9802
error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);
9803
9803
return unknownType;
9804
9804
}
@@ -10166,7 +10166,7 @@ namespace ts {
10166
10166
const index = indexOf(arrayLiteral.elements, node);
10167
10167
return getTypeOfPropertyOfContextualType(type, "" + index)
10168
10168
|| getIndexTypeOfContextualType(type, IndexKind.Number)
10169
- || (languageVersion >= ScriptTarget.ES6 ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined);
10169
+ || (languageVersion >= ScriptTarget.ES2015 ? getElementTypeOfIterable(type, /*errorNode*/ undefined) : undefined);
10170
10170
}
10171
10171
return undefined;
10172
10172
}
@@ -10399,7 +10399,7 @@ namespace ts {
10399
10399
// if there is no index type / iterated type.
10400
10400
const restArrayType = checkExpression((<SpreadElementExpression>e).expression, contextualMapper);
10401
10401
const restElementType = getIndexTypeOfType(restArrayType, IndexKind.Number) ||
10402
- (languageVersion >= ScriptTarget.ES6 ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined);
10402
+ (languageVersion >= ScriptTarget.ES2015 ? getElementTypeOfIterable(restArrayType, /*errorNode*/ undefined) : undefined);
10403
10403
if (restElementType) {
10404
10404
elementTypes.push(restElementType);
10405
10405
}
@@ -11146,7 +11146,7 @@ namespace ts {
11146
11146
// - In a static member function or static member accessor
11147
11147
// where this references the constructor function object of a derived class,
11148
11148
// 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) {
11150
11150
// `prop` refers to a *property* declared in the super class
11151
11151
// rather than a *method*, so it does not satisfy the above criteria.
11152
11152
@@ -14468,7 +14468,7 @@ namespace ts {
14468
14468
}
14469
14469
14470
14470
if (node.type) {
14471
- if (languageVersion >= ScriptTarget.ES6 && isSyntacticallyValidGenerator(node)) {
14471
+ if (languageVersion >= ScriptTarget.ES2015 && isSyntacticallyValidGenerator(node)) {
14472
14472
const returnType = getTypeFromTypeNode(node.type);
14473
14473
if (returnType === voidType) {
14474
14474
error(node.type, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
@@ -15429,7 +15429,7 @@ namespace ts {
15429
15429
* callable `then` signature.
15430
15430
*/
15431
15431
function checkAsyncFunctionReturnType(node: FunctionLikeDeclaration): Type {
15432
- if (languageVersion >= ScriptTarget.ES6 ) {
15432
+ if (languageVersion >= ScriptTarget.ES2015 ) {
15433
15433
const returnType = getTypeFromTypeNode(node.type);
15434
15434
return checkCorrectPromiseType(returnType, node.type, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
15435
15435
}
@@ -15958,7 +15958,7 @@ namespace ts {
15958
15958
15959
15959
function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) {
15960
15960
// No need to check for require or exports for ES6 modules and later
15961
- if (modulekind >= ModuleKind.ES6 ) {
15961
+ if (modulekind >= ModuleKind.ES2015 ) {
15962
15962
return;
15963
15963
}
15964
15964
@@ -16454,7 +16454,7 @@ namespace ts {
16454
16454
if (isTypeAny(inputType)) {
16455
16455
return inputType;
16456
16456
}
16457
- if (languageVersion >= ScriptTarget.ES6 ) {
16457
+ if (languageVersion >= ScriptTarget.ES2015 ) {
16458
16458
return checkElementTypeOfIterable(inputType, errorNode);
16459
16459
}
16460
16460
if (allowStringInput) {
@@ -16632,7 +16632,7 @@ namespace ts {
16632
16632
* 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable).
16633
16633
*/
16634
16634
function checkElementTypeOfArrayOrString(arrayOrStringType: Type, errorNode: Node): Type {
16635
- Debug.assert(languageVersion < ScriptTarget.ES6 );
16635
+ Debug.assert(languageVersion < ScriptTarget.ES2015 );
16636
16636
16637
16637
// After we remove all types that are StringLike, we will know if there was a string constituent
16638
16638
// based on whether the remaining type is the same as the initial type.
@@ -17943,7 +17943,7 @@ namespace ts {
17943
17943
}
17944
17944
}
17945
17945
else {
17946
- if (modulekind === ModuleKind.ES6 && !isInAmbientContext(node)) {
17946
+ if (modulekind === ModuleKind.ES2015 && !isInAmbientContext(node)) {
17947
17947
// Import equals declaration is deprecated in es6 or above
17948
17948
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);
17949
17949
}
@@ -18031,7 +18031,7 @@ namespace ts {
18031
18031
checkExternalModuleExports(container);
18032
18032
18033
18033
if (node.isExportEquals && !isInAmbientContext(node)) {
18034
- if (modulekind === ModuleKind.ES6 ) {
18034
+ if (modulekind === ModuleKind.ES2015 ) {
18035
18035
// export assignment is not supported in es6 modules
18036
18036
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_2015_modules_Consider_using_export_default_or_another_module_format_instead);
18037
18037
}
@@ -19543,7 +19543,7 @@ namespace ts {
19543
19543
19544
19544
getGlobalTemplateStringsArrayType = memoize(() => getGlobalType("TemplateStringsArray"));
19545
19545
19546
- if (languageVersion >= ScriptTarget.ES6 ) {
19546
+ if (languageVersion >= ScriptTarget.ES2015 ) {
19547
19547
getGlobalESSymbolType = memoize(() => getGlobalType("Symbol"));
19548
19548
getGlobalIterableType = memoize(() => <GenericType>getGlobalType("Iterable", /*arity*/ 1));
19549
19549
getGlobalIteratorType = memoize(() => <GenericType>getGlobalType("Iterator", /*arity*/ 1));
@@ -19577,7 +19577,7 @@ namespace ts {
19577
19577
// If we found the module, report errors if it does not have the necessary exports.
19578
19578
if (helpersModule) {
19579
19579
const exports = helpersModule.exports;
19580
- if (requestedExternalEmitHelpers & NodeFlags.HasClassExtends && languageVersion < ScriptTarget.ES6 ) {
19580
+ if (requestedExternalEmitHelpers & NodeFlags.HasClassExtends && languageVersion < ScriptTarget.ES2015 ) {
19581
19581
verifyHelperSymbol(exports, "__extends", SymbolFlags.Value);
19582
19582
}
19583
19583
if (requestedExternalEmitHelpers & NodeFlags.HasJsxSpreadAttributes && compilerOptions.jsx !== JsxEmit.Preserve) {
@@ -19594,7 +19594,7 @@ namespace ts {
19594
19594
}
19595
19595
if (requestedExternalEmitHelpers & NodeFlags.HasAsyncFunctions) {
19596
19596
verifyHelperSymbol(exports, "__awaiter", SymbolFlags.Value);
19597
- if (languageVersion < ScriptTarget.ES6 ) {
19597
+ if (languageVersion < ScriptTarget.ES2015 ) {
19598
19598
verifyHelperSymbol(exports, "__generator", SymbolFlags.Value);
19599
19599
}
19600
19600
}
@@ -20171,7 +20171,7 @@ namespace ts {
20171
20171
if (!node.body) {
20172
20172
return grammarErrorOnNode(node.asteriskToken, Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator);
20173
20173
}
20174
- if (languageVersion < ScriptTarget.ES6 ) {
20174
+ if (languageVersion < ScriptTarget.ES2015 ) {
20175
20175
return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher);
20176
20176
}
20177
20177
}
0 commit comments