@@ -971,22 +971,21 @@ impl Compiler {
971
971
Default :: default ( )
972
972
} ;
973
973
974
- let dts_code = if emit_dts && program . is_module ( ) {
974
+ let dts_code = if emit_dts {
975
975
let ( leading, trailing) = comments. borrow_all ( ) ;
976
976
977
977
let leading = std:: rc:: Rc :: new ( RefCell :: new ( leading. clone ( ) ) ) ;
978
978
let trailing = std:: rc:: Rc :: new ( RefCell :: new ( trailing. clone ( ) ) ) ;
979
979
980
980
let comments = SingleThreadedComments :: from_leading_and_trailing ( leading, trailing) ;
981
981
let mut checker = FastDts :: new ( fm. name . clone ( ) ) ;
982
- let mut module = program. clone ( ) ;
982
+ let mut program = program. clone ( ) ;
983
983
984
984
if let Some ( ( base, resolver) ) = config. resolver {
985
- module . mutate ( import_rewriter ( base, resolver) ) ;
985
+ program . mutate ( import_rewriter ( base, resolver) ) ;
986
986
}
987
987
988
- let mut module = module. expect_module ( ) ;
989
- let issues = checker. transform ( & mut module) ;
988
+ let issues = checker. transform ( & mut program) ;
990
989
991
990
for issue in issues {
992
991
let range = issue. range ( ) ;
@@ -995,7 +994,8 @@ impl Compiler {
995
994
. struct_span_err ( range. span , & issue. to_string ( ) )
996
995
. emit ( ) ;
997
996
}
998
- let dts_code = to_code_with_comments ( Some ( & comments) , & module) ;
997
+
998
+ let dts_code = to_code_with_comments ( Some ( & comments) , & program) ;
999
999
Some ( dts_code)
1000
1000
} else {
1001
1001
None
0 commit comments