diff options
Diffstat (limited to 'runtime/js/30_fs.js')
-rw-r--r-- | runtime/js/30_fs.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/js/30_fs.js b/runtime/js/30_fs.js index bdd575f19..51f2c411e 100644 --- a/runtime/js/30_fs.js +++ b/runtime/js/30_fs.js @@ -5,7 +5,9 @@ const core = window.Deno.core; const { Date, + DatePrototype, MathTrunc, + ObjectPrototypeIsPrototypeOf, SymbolAsyncIterator, SymbolIterator, } = window.__bootstrap.primordials; @@ -277,7 +279,7 @@ } function toUnixTimeFromEpoch(value) { - if (value instanceof Date) { + if (ObjectPrototypeIsPrototypeOf(DatePrototype, value)) { const time = value.valueOf(); const seconds = MathTrunc(time / 1e3); const nanoseconds = MathTrunc(time - (seconds * 1e3)) * 1e6; |