summaryrefslogtreecommitdiff
path: root/ext/node/polyfills
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills')
-rw-r--r--ext/node/polyfills/01_require.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js
index 092e7490a..eb845f237 100644
--- a/ext/node/polyfills/01_require.js
+++ b/ext/node/polyfills/01_require.js
@@ -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