Skip to content

Commit ee73111

Browse files
committed
recover from empty dirs
1 parent 7c9d43e commit ee73111

File tree

1 file changed

+5
-2
lines changed
  • turbopack/crates/turbopack-ecmascript/benches

1 file changed

+5
-2
lines changed

turbopack/crates/turbopack-ecmascript/benches/analyzer.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ pub fn benchmark(c: &mut Criterion) {
4141
for result in results {
4242
let entry = result.unwrap();
4343
if entry.file_type().unwrap().is_dir() {
44-
let name = entry.file_name().into_string().unwrap();
4544
let input = entry.path().join("input.js");
46-
45+
if !input.exists() {
46+
eprintln!("Missing file: {input:?} skipping");
47+
continue;
48+
}
49+
let name = entry.file_name().into_string().unwrap();
4750
let cm = Arc::new(SourceMap::new(FilePathMapping::empty()));
4851
let fm = cm.load_file(&input).unwrap();
4952
GLOBALS.set(&swc_core::common::Globals::new(), || {

0 commit comments

Comments
 (0)