mirror of
https://github.com/denoland/deno.git
synced 2025-01-08 07:08:27 -05:00
fix(require): use canonicalized path for loading content (#20133)
This commit is contained in:
parent
9f761fa2cd
commit
b3980a0579
1 changed files with 4 additions and 2 deletions
|
@ -833,7 +833,9 @@ Module._resolveFilename = function (
|
||||||
isMain,
|
isMain,
|
||||||
parentPath,
|
parentPath,
|
||||||
);
|
);
|
||||||
if (filename) return filename;
|
if (filename) {
|
||||||
|
return ops.op_require_real_path(filename);
|
||||||
|
}
|
||||||
const requireStack = [];
|
const requireStack = [];
|
||||||
for (let cursor = parent; cursor; cursor = moduleParentCache.get(cursor)) {
|
for (let cursor = parent; cursor; cursor = moduleParentCache.get(cursor)) {
|
||||||
ArrayPrototypePush(requireStack, cursor.filename || cursor.id);
|
ArrayPrototypePush(requireStack, cursor.filename || cursor.id);
|
||||||
|
@ -891,7 +893,7 @@ Module.prototype.load = function (filename) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Module._extensions[extension](this, filename);
|
Module._extensions[extension](this, this.filename);
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
|
||||||
// TODO: do caching
|
// TODO: do caching
|
||||||
|
|
Loading…
Reference in a new issue