summaryrefslogtreecommitdiff
path: root/runtime/js/06_util.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-01-27 13:36:36 +0100
committerGitHub <noreply@github.com>2022-01-27 13:36:36 +0100
commit884143218fad0e18f7553aaf079d52de703f7601 (patch)
tree9b9e9d30ea647041438ef8fa974b8d4234cabf73 /runtime/js/06_util.js
parentdcf8f144ab0516936bfa4e93357d71f1732d880e (diff)
refactor: update runtime code for primordial checks for "instanceof" (#13497)
Diffstat (limited to 'runtime/js/06_util.js')
-rw-r--r--runtime/js/06_util.js11
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.");
}