diff options
Diffstat (limited to 'runtime/js/40_files.js')
-rw-r--r-- | runtime/js/40_files.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/js/40_files.js b/runtime/js/40_files.js index 82cf19ffc..dfd471750 100644 --- a/runtime/js/40_files.js +++ b/runtime/js/40_files.js @@ -6,6 +6,11 @@ const { read, readSync, write, writeSync } = window.__bootstrap.io; const { ftruncate, ftruncateSync, fstat, fstatSync } = window.__bootstrap.fs; const { pathFromURL } = window.__bootstrap.util; + const { + Error, + ObjectValues, + ArrayPrototypeFilter, + } = window.__bootstrap.primordials; function seekSync( rid, @@ -193,7 +198,12 @@ const stderr = new Stderr(); function checkOpenOptions(options) { - if (Object.values(options).filter((val) => val === true).length === 0) { + if ( + ArrayPrototypeFilter( + ObjectValues(options), + (val) => val === true, + ).length === 0 + ) { throw new Error("OpenOptions requires at least one option to be true"); } |