File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -727,13 +727,15 @@ function runTestsAndWriteOutput(file) {
727727 var tapNotOk = / ^ n o t \s o k / ;
728728 var tapComment = / ^ # / ;
729729 var typeError = / ^ \s + T y p e E r r o r : / ;
730+ var debugError = / ^ \s + E r r o r : \s D e b u g \s F a i l u r e \. / ;
730731 var progress = new ProgressBar ( "Running tests..." ) ;
731732 var expectedTestCount = 0 ;
732733 var testCount = 0 ;
733734 var failureCount = 0 ;
734735 var successCount = 0 ;
735736 var comments = [ ] ;
736737 var typeErrorCount = 0 ;
738+ var debugErrorCount = 0 ;
737739
738740 ex . addListener ( "stdout" , function ( output ) {
739741 var m = tapRange . exec ( output ) ;
@@ -757,6 +759,9 @@ function runTestsAndWriteOutput(file) {
757759 else if ( typeError . test ( output ) ) {
758760 typeErrorCount ++ ;
759761 }
762+ else if ( debugError . test ( output ) ) {
763+ debugErrorCount ++ ;
764+ }
760765 return ;
761766 }
762767
@@ -806,6 +811,10 @@ function runTestsAndWriteOutput(file) {
806811 console . log ( "# type errors: %s" , typeErrorCount ) ;
807812 }
808813
814+ if ( debugErrorCount ) {
815+ console . log ( "# debug errors: %s" , debugErrorCount ) ;
816+ }
817+
809818 deleteTemporaryProjectOutput ( ) ;
810819 if ( beep ) process . stdout . write ( "\u0007" ) ;
811820 fail ( "Process exited with code " + status ) ;
Original file line number Diff line number Diff line change 44/*@internal */
55namespace ts {
66 export function transformES6Module ( context : TransformationContext ) {
7+ const compilerOptions = context . getCompilerOptions ( ) ;
8+ const resolver = context . getEmitResolver ( ) ;
9+
10+ let currentSourceFile : SourceFile ;
11+
712 return transformSourceFile ;
813
914 function transformSourceFile ( node : SourceFile ) {
15+ if ( isExternalModule ( node ) || compilerOptions . isolatedModules ) {
16+ currentSourceFile = node ;
17+ return visitEachChild ( node , visitor , context ) ;
18+ }
19+ return node ;
20+ }
21+
22+ function visitor ( node : Node ) {
23+ switch ( node . kind ) {
24+ case SyntaxKind . ImportDeclaration :
25+ return visitImportDeclaration ( < ImportDeclaration > node ) ;
26+ }
27+
28+ return node ;
29+ }
30+
31+ function visitImportDeclaration ( node : ImportDeclaration ) {
32+ if ( node . importClause && ! resolver . isReferencedAliasDeclaration ( node . importClause , /*checkChildren*/ true ) ) {
33+ return undefined ;
34+ }
35+
1036 return node ;
1137 }
1238 }
Original file line number Diff line number Diff line change @@ -3405,6 +3405,7 @@ namespace ts {
34053405 || kind === SyntaxKind . TypeAliasDeclaration
34063406 || kind === SyntaxKind . EnumDeclaration
34073407 || kind === SyntaxKind . ModuleDeclaration
3408+ || kind === SyntaxKind . ImportDeclaration
34083409 || kind === SyntaxKind . ImportEqualsDeclaration
34093410 || kind === SyntaxKind . ExportDeclaration
34103411 || kind === SyntaxKind . ExportAssignment ;
You can’t perform that action at this time.
0 commit comments