Skip to content

Commit 3dd93eb

Browse files
authored
fix microbench when microbench.txt is missing (bellard#246)
1 parent 35b7b3c commit 3dd93eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/microbench.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,11 +1134,12 @@ function load_result(filename)
11341134
if (typeof std !== "undefined") {
11351135
// read the file in QuickJS
11361136
var f = std.open(filename, "r");
1137-
if (!f) {
1137+
if (f) {
1138+
str = f.readAsString();
1139+
f.close();
1140+
} else {
11381141
has_error = true;
11391142
}
1140-
str = f.readAsString();
1141-
f.close();
11421143
} else {
11431144
return null;
11441145
}

0 commit comments

Comments
 (0)