mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
fix(require): use canonicalized path for loading content (#20133)
This commit is contained in:
parent
4001fad25f
commit
6a5b02bc79
1 changed files with 4 additions and 2 deletions
|
@ -833,7 +833,9 @@ Module._resolveFilename = function (
|
|||
isMain,
|
||||
parentPath,
|
||||
);
|
||||
if (filename) return filename;
|
||||
if (filename) {
|
||||
return ops.op_require_real_path(filename);
|
||||
}
|
||||
const requireStack = [];
|
||||
for (let cursor = parent; cursor; cursor = moduleParentCache.get(cursor)) {
|
||||
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;
|
||||
|
||||
// TODO: do caching
|
||||
|
|
Loading…
Reference in a new issue