File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/incremental-typescript-compiler Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ module.exports = class IncrementalTypescriptCompiler {
29
29
30
30
this . _ts = project . require ( 'typescript' ) ;
31
31
this . _watchProgram = null ;
32
+ this . _compilerOptions = null ;
32
33
}
33
34
34
35
treeForHost ( ) {
@@ -115,6 +116,10 @@ module.exports = class IncrementalTypescriptCompiler {
115
116
}
116
117
}
117
118
} ) ;
119
+
120
+ // Prefetch the compiler options, because fetching them while reporting a diagnostic
121
+ // can result in a diagnostic-reporting loop in certain states
122
+ this . _compilerOptions = this . getProgram ( ) . getCompilerOptions ( ) ;
118
123
}
119
124
120
125
getProgram ( ) {
@@ -130,8 +135,7 @@ module.exports = class IncrementalTypescriptCompiler {
130
135
}
131
136
132
137
_shouldFailOnTypeError ( ) {
133
- let options = this . getProgram ( ) . getCompilerOptions ( ) ;
134
- return ! ! options . noEmitOnError ;
138
+ return ! ! this . _compilerOptions . noEmitOnError ;
135
139
}
136
140
137
141
_mirageDirectory ( ) {
You can’t perform that action at this time.
0 commit comments