fix microbench when microbench.txt is missing (#246)

This commit is contained in:
Charlie Gordon 2024-03-03 03:38:49 +01:00 committed by GitHub
parent 35b7b3c379
commit 3dd93eb4e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1134,11 +1134,12 @@ function load_result(filename)
if (typeof std !== "undefined") {
// read the file in QuickJS
var f = std.open(filename, "r");
if (!f) {
if (f) {
str = f.readAsString();
f.close();
} else {
has_error = true;
}
str = f.readAsString();
f.close();
} else {
return null;
}