@@ -5817,7 +5817,7 @@ namespace ts {
58175817 const typeReferenceDirectives : FileReference [ ] = [ ] ;
58185818 const amdDependencies : { path : string ; name : string } [ ] = [ ] ;
58195819 let amdModuleName : string ;
5820- let hasCheckDirective = false ;
5820+ let checkJsDirective : CheckJsDirective = undefined ;
58215821
58225822 // Keep scanning all the leading trivia in the file until we get to something that
58235823 // isn't trivia. Any single line comment will be analyzed to see if it is a
@@ -5880,16 +5880,23 @@ namespace ts {
58805880 }
58815881 }
58825882
5883- const checkDirectiveRegEx = / ^ \/ \/ \s * @ c h e c k \s * / gim;
5884- hasCheckDirective = hasCheckDirective || ! ! checkDirectiveRegEx . exec ( comment ) ;
5883+ const checkJsDirectiveRegEx = / ^ \/ \/ \/ ? \s * @ c h e c k ( \s + ( t r u e | f a l s e ) ) ? / gim;
5884+ const checkJsDirectiveMatchResult = checkJsDirectiveRegEx . exec ( comment ) ;
5885+ if ( checkJsDirectiveMatchResult ) {
5886+ checkJsDirective = {
5887+ enabled : compareStrings ( checkJsDirectiveMatchResult [ 2 ] , "false" , /*ignoreCase*/ true ) !== Comparison . EqualTo ,
5888+ end : range . end ,
5889+ pos : range . pos
5890+ } ;
5891+ }
58855892 }
58865893 }
58875894
58885895 sourceFile . referencedFiles = referencedFiles ;
58895896 sourceFile . typeReferenceDirectives = typeReferenceDirectives ;
58905897 sourceFile . amdDependencies = amdDependencies ;
58915898 sourceFile . moduleName = amdModuleName ;
5892- sourceFile . hasCheckDirective = hasCheckDirective ;
5899+ sourceFile . checkJsDirective = checkJsDirective ;
58935900 }
58945901
58955902 function setExternalModuleIndicator ( sourceFile : SourceFile ) {
0 commit comments