Skip to content

Commit 9c9bfef

Browse files
authored
fix: add support for passing v8 flags on deno check (#30868)
1 parent 0c4479a commit 9c9bfef

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

cli/args/flags.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,7 @@ Unless --reload is specified, this command will not re-download already cached d
22152215
)
22162216
.arg(allow_import_arg())
22172217
.arg(deny_import_arg())
2218+
.arg(v8_flags_arg())
22182219
}
22192220
)
22202221
}
@@ -5098,6 +5099,7 @@ fn check_parse(
50985099
flags.type_check_mode = TypeCheckMode::Local;
50995100
compile_args_without_check_parse(flags, matches)?;
51005101
unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionAndRuntime);
5102+
v8_flags_arg_parse(flags, matches);
51015103
let files = match matches.remove_many::<String>("file") {
51025104
Some(f) => f.collect(),
51035105
None => vec![".".to_string()], // default
@@ -12983,4 +12985,25 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n"
1298312985
}
1298412986
);
1298512987
}
12988+
12989+
#[test]
12990+
fn check_with_v8_flags() {
12991+
let flags =
12992+
flags_from_vec(svec!["deno", "check", "--v8-flags=--help", "script.ts",])
12993+
.unwrap();
12994+
assert_eq!(
12995+
flags,
12996+
Flags {
12997+
subcommand: DenoSubcommand::Check(CheckFlags {
12998+
files: svec!["script.ts"],
12999+
doc: false,
13000+
doc_only: false,
13001+
}),
13002+
type_check_mode: TypeCheckMode::Local,
13003+
code_cache_enabled: true,
13004+
v8_flags: svec!["--help"],
13005+
..Flags::default()
13006+
}
13007+
);
13008+
}
1298613009
}

0 commit comments

Comments
 (0)