diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-01 18:06:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 18:06:11 +0100 |
commit | 8176a4d1663529fb8aeebf7734c4994fa1d583f4 (patch) | |
tree | 94c7d6eb2679e641f59cf78640340f5b7af0022e /runtime/js/06_util.js | |
parent | abf89f8c4675ed78c992fafd6d758bf4bfca8a1a (diff) |
refactor: primordials for instanceof (#13527)
Diffstat (limited to 'runtime/js/06_util.js')
-rw-r--r-- | runtime/js/06_util.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index 9b255615e..e934c4f0e 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -3,14 +3,15 @@ ((window) => { const { - StringPrototypeReplace, - TypeError, - Promise, decodeURIComponent, Error, + ObjectPrototypeIsPrototypeOf, + Promise, + StringPrototypeReplace, + TypeError, } = window.__bootstrap.primordials; const { build } = window.__bootstrap.build; - const { URL } = window.__bootstrap.url; + const { URLPrototype } = window.__bootstrap.url; let logDebug = false; let logSource = "JS"; @@ -93,7 +94,7 @@ } function pathFromURL(pathOrUrl) { - if (pathOrUrl instanceof URL) { + if (ObjectPrototypeIsPrototypeOf(URLPrototype, pathOrUrl)) { if (pathOrUrl.protocol != "file:") { throw new TypeError("Must be a file URL."); } |