File tree Expand file tree Collapse file tree 4 files changed +81
-1
lines changed
testdata/compile/compiler_options Expand file tree Collapse file tree 4 files changed +81
-1
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,12 @@ pub async fn compile(
72
72
graph
73
73
} ;
74
74
75
+ let ts_config_for_emit =
76
+ cli_options. resolve_ts_config_for_emit ( deno_config:: TsConfigType :: Emit ) ?;
77
+ let emit_options =
78
+ crate :: args:: ts_config_to_emit_options ( ts_config_for_emit. ts_config ) ;
75
79
let parser = parsed_source_cache. as_capturing_parser ( ) ;
76
- let eszip = eszip:: EszipV2 :: from_graph ( graph, & parser, Default :: default ( ) ) ?;
80
+ let eszip = eszip:: EszipV2 :: from_graph ( graph, & parser, emit_options ) ?;
77
81
78
82
log:: info!(
79
83
"{} {} to {}" ,
Original file line number Diff line number Diff line change @@ -1178,3 +1178,32 @@ fn dynamic_import_bad_data_uri() {
1178
1178
"[WILDCARD]TypeError: Unable to decode data url.[WILDCARD]" ,
1179
1179
) ;
1180
1180
}
1181
+
1182
+ #[ test]
1183
+ fn standalone_config_file_respects_compiler_options ( ) {
1184
+ let context = TestContextBuilder :: new ( ) . build ( ) ;
1185
+ let dir = context. temp_dir ( ) ;
1186
+ let exe = if cfg ! ( windows) {
1187
+ dir. path ( ) . join ( "compiler_options.exe" )
1188
+ } else {
1189
+ dir. path ( ) . join ( "compiler_options" )
1190
+ } ;
1191
+ context
1192
+ . new_command ( )
1193
+ . args_vec ( [
1194
+ "compile" ,
1195
+ "--allow-read" ,
1196
+ "--config" ,
1197
+ "compile/compiler_options/deno.json" ,
1198
+ "--output" ,
1199
+ & exe. to_string_lossy ( ) ,
1200
+ "./compile/compiler_options/main.ts" ,
1201
+ ] )
1202
+ . run ( )
1203
+ . skip_output_check ( )
1204
+ . assert_exit_code ( 0 ) ;
1205
+ let output = context. new_command ( ) . name ( & exe) . run ( ) ;
1206
+
1207
+ output. assert_exit_code ( 0 ) ;
1208
+ output. assert_matches_text ( "[WILDCARD]C.test() called[WILDCARD]" ) ;
1209
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "experimentalDecorators" : true
4
+ }
5
+ }
Original file line number Diff line number Diff line change
1
+ // deno-lint-ignore-file
2
+ function a ( ) {
3
+ console . log ( "@A evaluated" ) ;
4
+ return function (
5
+ target : any ,
6
+ propertyKey : string ,
7
+ descriptor : PropertyDescriptor ,
8
+ ) {
9
+ console . log ( "@A called" ) ;
10
+ const fn = descriptor . value ;
11
+ descriptor . value = function ( ) {
12
+ console . log ( "fn() called from @A" ) ;
13
+ fn ( ) ;
14
+ } ;
15
+ } ;
16
+ }
17
+
18
+ function b ( ) {
19
+ console . log ( "@B evaluated" ) ;
20
+ return function (
21
+ target : any ,
22
+ propertyKey : string ,
23
+ descriptor : PropertyDescriptor ,
24
+ ) {
25
+ console . log ( "@B called" ) ;
26
+ const fn = descriptor . value ;
27
+ descriptor . value = function ( ) {
28
+ console . log ( "fn() called from @B" ) ;
29
+ fn ( ) ;
30
+ } ;
31
+ } ;
32
+ }
33
+
34
+ class C {
35
+ @a ( )
36
+ @b ( )
37
+ static test ( ) {
38
+ console . log ( "C.test() called" ) ;
39
+ }
40
+ }
41
+
42
+ C . test ( ) ;
You can’t perform that action at this time.
0 commit comments