@@ -395,7 +395,7 @@ namespace ts {
395
395
}
396
396
}
397
397
398
- return substituteConstantValue ( node ) ;
398
+ return node ;
399
399
}
400
400
401
401
function substituteElementAccessExpression ( node : ElementAccessExpression ) {
@@ -410,39 +410,9 @@ namespace ts {
410
410
}
411
411
}
412
412
413
- return substituteConstantValue ( node ) ;
414
- }
415
-
416
- function substituteConstantValue ( node : PropertyAccessExpression | ElementAccessExpression ) : LeftHandSideExpression {
417
- const constantValue = tryGetConstEnumValue ( node ) ;
418
- if ( constantValue !== undefined ) {
419
- const substitute = createLiteral ( constantValue ) ;
420
- setSourceMapRange ( substitute , node ) ;
421
- setCommentRange ( substitute , node ) ;
422
- if ( ! compilerOptions . removeComments ) {
423
- const propertyName = isPropertyAccessExpression ( node )
424
- ? declarationNameToString ( node . name )
425
- : getTextOfNode ( node . argumentExpression ) ;
426
- substitute . trailingComment = ` ${ propertyName } ` ;
427
- }
428
-
429
- setConstantValue ( node , constantValue ) ;
430
- return substitute ;
431
- }
432
-
433
413
return node ;
434
414
}
435
415
436
- function tryGetConstEnumValue ( node : Node ) : number {
437
- if ( compilerOptions . isolatedModules ) {
438
- return undefined ;
439
- }
440
-
441
- return isPropertyAccessExpression ( node ) || isElementAccessExpression ( node )
442
- ? resolver . getConstantValue ( < PropertyAccessExpression | ElementAccessExpression > node )
443
- : undefined ;
444
- }
445
-
446
416
function substituteCallExpression ( node : CallExpression ) : Expression {
447
417
const expression = node . expression ;
448
418
if ( isSuperProperty ( expression ) ) {
0 commit comments