@@ -266,7 +266,7 @@ module ts {
266
266
}
267
267
}
268
268
else {
269
- // Single line comment of styly //....
269
+ // Single line comment of style //....
270
270
writer . write ( currentSourceFile . text . substring ( comment . pos , comment . end ) ) ;
271
271
}
272
272
@@ -393,15 +393,15 @@ module ts {
393
393
}
394
394
395
395
var prevEncodedEmittedColumn = lastEncodedSourceMapSpan . emittedColumn ;
396
- // Line/Comma deliminators
396
+ // Line/Comma delimiters
397
397
if ( lastEncodedSourceMapSpan . emittedLine == lastRecordedSourceMapSpan . emittedLine ) {
398
398
// Emit comma to separate the entry
399
399
if ( sourceMapData . sourceMapMappings ) {
400
400
sourceMapData . sourceMapMappings += "," ;
401
401
}
402
402
}
403
403
else {
404
- // Emit line deliminators
404
+ // Emit line delimiters
405
405
for ( var encodedLine = lastEncodedSourceMapSpan . emittedLine ; encodedLine < lastRecordedSourceMapSpan . emittedLine ; encodedLine ++ ) {
406
406
sourceMapData . sourceMapMappings += ";" ;
407
407
}
@@ -470,7 +470,7 @@ module ts {
470
470
var emittedLine = writer . getLine ( ) ;
471
471
var emittedColumn = writer . getColumn ( ) ;
472
472
473
- // If this location wasnt recorded or the location in source is going backwards, record the span
473
+ // If this location wasn't recorded or the location in source is going backwards, record the span
474
474
if ( ! lastRecordedSourceMapSpan ||
475
475
lastRecordedSourceMapSpan . emittedLine != emittedLine ||
476
476
lastRecordedSourceMapSpan . emittedColumn != emittedColumn ||
@@ -516,7 +516,7 @@ module ts {
516
516
}
517
517
518
518
function recordNewSourceFileStart ( node : SourceFile ) {
519
- // Add the the file to tsFilePaths
519
+ // Add the file to tsFilePaths
520
520
// If sourceroot option: Use the relative path corresponding to the common directory path
521
521
// otherwise source locations relative to map file location
522
522
var sourcesDirectoryPath = compilerOptions . sourceRoot ? program . getCommonSourceDirectory ( ) : sourceMapDir ;
@@ -953,7 +953,7 @@ module ts {
953
953
write ( tokenToString ( node . operator ) ) ;
954
954
}
955
955
// In some cases, we need to emit a space between the operator and the operand. One obvious case
956
- // is when the operator is an identifer , like delete or typeof. We also need to do this for plus
956
+ // is when the operator is an identifier , like delete or typeof. We also need to do this for plus
957
957
// and minus expressions in certain cases. Specifically, consider the following two cases (parens
958
958
// are just for clarity of exposition, and not part of the source code):
959
959
//
@@ -1755,16 +1755,13 @@ module ts {
1755
1755
if ( ! isInstantiated ( node ) ) {
1756
1756
return emitPinnedOrTripleSlashComments ( node ) ;
1757
1757
}
1758
-
1759
1758
emitLeadingComments ( node ) ;
1760
- if ( ! ( node . flags & NodeFlags . Export ) ) {
1761
- emitStart ( node ) ;
1762
- write ( "var " ) ;
1763
- emit ( node . name ) ;
1764
- write ( ";" ) ;
1765
- emitEnd ( node ) ;
1766
- writeLine ( ) ;
1767
- }
1759
+ emitStart ( node ) ;
1760
+ write ( "var " ) ;
1761
+ emit ( node . name ) ;
1762
+ write ( ";" ) ;
1763
+ emitEnd ( node ) ;
1764
+ writeLine ( ) ;
1768
1765
emitStart ( node ) ;
1769
1766
write ( "(function (" ) ;
1770
1767
emitStart ( node . name ) ;
@@ -1788,21 +1785,15 @@ module ts {
1788
1785
scopeEmitEnd ( ) ;
1789
1786
}
1790
1787
write ( ")(" ) ;
1788
+ if ( node . flags & NodeFlags . Export ) {
1789
+ emit ( node . name ) ;
1790
+ write ( " = " ) ;
1791
+ }
1791
1792
emitModuleMemberName ( node ) ;
1792
1793
write ( " || (" ) ;
1793
1794
emitModuleMemberName ( node ) ;
1794
1795
write ( " = {}));" ) ;
1795
1796
emitEnd ( node ) ;
1796
- if ( node . flags & NodeFlags . Export ) {
1797
- writeLine ( ) ;
1798
- emitStart ( node ) ;
1799
- write ( "var " ) ;
1800
- emit ( node . name ) ;
1801
- write ( " = " ) ;
1802
- emitModuleMemberName ( node ) ;
1803
- emitEnd ( node ) ;
1804
- write ( ";" ) ;
1805
- }
1806
1797
emitTrailingComments ( node ) ;
1807
1798
}
1808
1799
@@ -2125,7 +2116,7 @@ module ts {
2125
2116
}
2126
2117
2127
2118
function getLeadingCommentsToEmit ( node : Node ) {
2128
- // Emit the leading comments only if the parent's pos doesnt match because parent should take care of emitting these comments
2119
+ // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments
2129
2120
if ( node . parent . kind === SyntaxKind . SourceFile || node . pos !== node . parent . pos ) {
2130
2121
var leadingComments : Comment [ ] ;
2131
2122
if ( hasDetachedComments ( node . pos ) ) {
@@ -2148,7 +2139,7 @@ module ts {
2148
2139
}
2149
2140
2150
2141
function emitTrailingDeclarationComments ( node : Node ) {
2151
- // Emit the trailing comments only if the parent's end doesnt match
2142
+ // Emit the trailing comments only if the parent's end doesn't match
2152
2143
if ( node . parent . kind === SyntaxKind . SourceFile || node . end !== node . parent . end ) {
2153
2144
var trailingComments = getTrailingComments ( currentSourceFile . text , node . end ) ;
2154
2145
// trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/
@@ -2224,7 +2215,7 @@ module ts {
2224
2215
return currentSourceFile . text . charCodeAt ( comment . pos + 2 ) === CharacterCodes . exclamation ;
2225
2216
}
2226
2217
// Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text
2227
- // so that we dont end up computing comment string and doing match for all // comments
2218
+ // so that we don't end up computing comment string and doing match for all // comments
2228
2219
else if ( currentSourceFile . text . charCodeAt ( comment . pos + 1 ) === CharacterCodes . slash &&
2229
2220
comment . pos + 2 < comment . end &&
2230
2221
currentSourceFile . text . charCodeAt ( comment . pos + 2 ) === CharacterCodes . slash &&
@@ -2700,7 +2691,7 @@ module ts {
2700
2691
}
2701
2692
2702
2693
function emitVariableDeclaration ( node : VariableDeclaration ) {
2703
- // If we are emitting property it isnt moduleElement and hence we already know it needs to be emitted
2694
+ // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted
2704
2695
// so there is no check needed to see if declaration is visible
2705
2696
if ( node . kind !== SyntaxKind . VariableDeclaration || resolver . isDeclarationVisible ( node ) ) {
2706
2697
emitSourceTextOfNode ( node . name ) ;
@@ -2724,7 +2715,7 @@ module ts {
2724
2715
Diagnostics . Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :
2725
2716
Diagnostics . Exported_variable_0_has_or_is_using_private_name_1 ;
2726
2717
}
2727
- // This check is to ensure we dont report error on constructor parameter property as that error would be reported during parameter emit
2718
+ // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit
2728
2719
else if ( node . kind === SyntaxKind . Property ) {
2729
2720
if ( node . flags & NodeFlags . Static ) {
2730
2721
diagnosticMessage = symbolAccesibilityResult . errorModuleName ?
@@ -2829,7 +2820,7 @@ module ts {
2829
2820
}
2830
2821
2831
2822
function emitFunctionDeclaration ( node : FunctionDeclaration ) {
2832
- // If we are emitting Method/Constructor it isnt moduleElement and hence already determined to be emitting
2823
+ // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting
2833
2824
// so no need to verify if the declaration is visible
2834
2825
if ( ( node . kind !== SyntaxKind . FunctionDeclaration || resolver . isDeclarationVisible ( node ) ) &&
2835
2826
! resolver . isImplementationOfOverload ( node ) ) {
@@ -3105,7 +3096,7 @@ module ts {
3105
3096
}
3106
3097
3107
3098
if ( root ) {
3108
- // Emiting single file so emit references in this file only
3099
+ // Emitting just a single file, so emit references in this file only
3109
3100
if ( ! compilerOptions . noResolve ) {
3110
3101
var addedGlobalFileReference = false ;
3111
3102
forEach ( root . referencedFiles , fileReference => {
@@ -3136,9 +3127,9 @@ module ts {
3136
3127
forEach ( sourceFile . referencedFiles , fileReference => {
3137
3128
var referencedFile = resolveScriptReference ( sourceFile , fileReference ) ;
3138
3129
3139
- // If the reference file is declaration file or external module emit that reference
3130
+ // If the reference file is a declaration file or an external module, emit that reference
3140
3131
if ( isExternalModuleOrDeclarationFile ( referencedFile ) &&
3141
- ! contains ( emittedReferencedFiles , referencedFile ) ) { // If the file refernece was not already emitted
3132
+ ! contains ( emittedReferencedFiles , referencedFile ) ) { // If the file reference was not already emitted
3142
3133
3143
3134
writeReferencePath ( referencedFile ) ;
3144
3135
emittedReferencedFiles . push ( referencedFile ) ;
0 commit comments