1
0
Fork 0
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:
Bartek Iwańczuk 2023-08-15 09:10:54 +02:00 committed by Divy Srivastava
parent 4001fad25f
commit 6a5b02bc79

View file

@ -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