@@ -2021,14 +2021,14 @@ module ts {
2021
2021
}
2022
2022
2023
2023
function emitLiteral ( node : LiteralExpression ) {
2024
- var text = compilerOptions . target < ScriptTarget . ES6 && isTemplateLiteralKind ( node . kind ) ? getTemplateLiteralAsStringLiteral ( node ) :
2024
+ var text = ! ( compilerOptions . target >= ScriptTarget . ES6 ) && isTemplateLiteralKind ( node . kind ) ? getTemplateLiteralAsStringLiteral ( node ) :
2025
2025
node . parent ? getSourceTextOfNodeFromSourceFile ( currentSourceFile , node ) :
2026
2026
node . text ;
2027
2027
if ( compilerOptions . sourceMap && ( node . kind === SyntaxKind . StringLiteral || isTemplateLiteralKind ( node . kind ) ) ) {
2028
2028
writer . writeLiteral ( text ) ;
2029
2029
}
2030
2030
// For version below ES6, emit binary integer literal and octal integer literal in canonical form
2031
- else if ( compilerOptions . target < ScriptTarget . ES6 && node . kind === SyntaxKind . NumericLiteral && isBinaryOrOctalIntegerLiteral ( text ) ) {
2031
+ else if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) && node . kind === SyntaxKind . NumericLiteral && isBinaryOrOctalIntegerLiteral ( text ) ) {
2032
2032
write ( node . text ) ;
2033
2033
}
2034
2034
else {
@@ -2150,7 +2150,7 @@ module ts {
2150
2150
//
2151
2151
// TODO (drosen): Note that we need to account for the upcoming 'yield' and
2152
2152
// spread ('...') unary operators that are anticipated for ES6.
2153
- Debug . assert ( compilerOptions . target < = ScriptTarget . ES5 ) ;
2153
+ Debug . assert ( ! ( compilerOptions . target > = ScriptTarget . ES6 ) ) ;
2154
2154
switch ( expression . kind ) {
2155
2155
case SyntaxKind . BinaryExpression :
2156
2156
switch ( ( < BinaryExpression > expression ) . operator ) {
@@ -2405,7 +2405,7 @@ module ts {
2405
2405
}
2406
2406
emitLeadingComments ( node ) ;
2407
2407
emit ( node . name ) ;
2408
- if ( compilerOptions . target < ScriptTarget . ES6 ) {
2408
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) ) {
2409
2409
write ( ": function " ) ;
2410
2410
}
2411
2411
emitSignatureAndBody ( node ) ;
@@ -2431,7 +2431,7 @@ module ts {
2431
2431
// export var obj = { y };
2432
2432
// }
2433
2433
// The short-hand property in obj need to emit as such ... = { y : m.y } regardless of the TargetScript version
2434
- if ( compilerOptions . target < ScriptTarget . ES6 || resolver . getExpressionNamePrefix ( node . name ) ) {
2434
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) || resolver . getExpressionNamePrefix ( node . name ) ) {
2435
2435
// Emit identifier as an identifier
2436
2436
write ( ": " ) ;
2437
2437
// Even though this is stored as identifier treat it as an expression
@@ -2605,7 +2605,7 @@ module ts {
2605
2605
2606
2606
2607
2607
function emitBinaryExpression ( node : BinaryExpression ) {
2608
- if ( compilerOptions . target < ScriptTarget . ES6 && node . operator === SyntaxKind . EqualsToken &&
2608
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) && node . operator === SyntaxKind . EqualsToken &&
2609
2609
( node . left . kind === SyntaxKind . ObjectLiteralExpression || node . left . kind === SyntaxKind . ArrayLiteralExpression ) ) {
2610
2610
emitDestructuring ( node ) ;
2611
2611
}
@@ -3101,7 +3101,7 @@ module ts {
3101
3101
function emitVariableDeclaration ( node : VariableDeclaration ) {
3102
3102
emitLeadingComments ( node ) ;
3103
3103
if ( isBindingPattern ( node . name ) ) {
3104
- if ( compilerOptions . target < ScriptTarget . ES6 ) {
3104
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) ) {
3105
3105
emitDestructuring ( node ) ;
3106
3106
}
3107
3107
else {
@@ -3136,7 +3136,7 @@ module ts {
3136
3136
3137
3137
function emitParameter ( node : ParameterDeclaration ) {
3138
3138
emitLeadingComments ( node ) ;
3139
- if ( compilerOptions . target < ScriptTarget . ES6 ) {
3139
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) ) {
3140
3140
if ( isBindingPattern ( node . name ) ) {
3141
3141
var name = createTempVariable ( node ) ;
3142
3142
if ( ! tempParameters ) {
@@ -3160,7 +3160,7 @@ module ts {
3160
3160
}
3161
3161
3162
3162
function emitDefaultValueAssignments ( node : FunctionLikeDeclaration ) {
3163
- if ( compilerOptions . target < ScriptTarget . ES6 ) {
3163
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) ) {
3164
3164
var tempIndex = 0 ;
3165
3165
forEach ( node . parameters , p => {
3166
3166
if ( isBindingPattern ( p . name ) ) {
@@ -3190,7 +3190,7 @@ module ts {
3190
3190
}
3191
3191
3192
3192
function emitRestParameter ( node : FunctionLikeDeclaration ) {
3193
- if ( compilerOptions . target < ScriptTarget . ES6 && hasRestParameters ( node ) ) {
3193
+ if ( ! ( compilerOptions . target >= ScriptTarget . ES6 ) && hasRestParameters ( node ) ) {
3194
3194
var restIndex = node . parameters . length - 1 ;
3195
3195
var restParam = node . parameters [ restIndex ] ;
3196
3196
var tempName = createTempVariable ( node , /*forLoopVariable*/ true ) . text ;
@@ -3269,7 +3269,7 @@ module ts {
3269
3269
write ( "(" ) ;
3270
3270
if ( node ) {
3271
3271
var parameters = node . parameters ;
3272
- var omitCount = compilerOptions . target < ScriptTarget . ES6 && hasRestParameters ( node ) ? 1 : 0 ;
3272
+ var omitCount = ! ( compilerOptions . target >= ScriptTarget . ES6 ) && hasRestParameters ( node ) ? 1 : 0 ;
3273
3273
emitList ( parameters , 0 , parameters . length - omitCount , /*multiLine*/ false , /*trailingComma*/ false ) ;
3274
3274
}
3275
3275
write ( ")" ) ;
0 commit comments