mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor: update runtime code for primordial checks for "instanceof" (#13497)
This commit is contained in:
parent
dcf8f144ab
commit
884143218f
41 changed files with 1030 additions and 660 deletions
|
@ -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.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue