Skip to content

Commit 4a5953c

Browse files
committed
loader: revert context changes
1 parent 63428bb commit 4a5953c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

lib/internal/modules/esm/get_format.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function getFileProtocolModuleFormat(url, context = { __proto__: null }, ignoreE
238238

239239
/**
240240
* @param {URL} url
241-
* @param {{parentURL: string, importAttributes?: Record<string, string>}} context
241+
* @param {{parentURL: string}} context
242242
* @returns {Promise<string> | string | undefined} only works when enabled
243243
*/
244244
function defaultGetFormatWithoutErrors(url, context) {
@@ -251,7 +251,7 @@ function defaultGetFormatWithoutErrors(url, context) {
251251

252252
/**
253253
* @param {URL} url
254-
* @param {{parentURL: string, importAttributes?: Record<string, string>}} context
254+
* @param {{parentURL: string}} context
255255
* @returns {Promise<string> | string | undefined} only works when enabled
256256
*/
257257
function defaultGetFormat(url, context) {

lib/internal/modules/esm/load.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ function defaultLoad(url, context = kEmptyObject) {
100100
}
101101

102102
// Now that we have the source for the module, run `defaultGetFormat` to detect its format.
103-
format ??= defaultGetFormat(urlInstance, {
104-
__proto__: context,
105-
importAttributes,
106-
});
103+
format ??= defaultGetFormat(urlInstance, context);
107104

108105
if (format === 'commonjs') {
109106
// For backward compatibility reasons, we need to discard the source in
@@ -171,10 +168,7 @@ function defaultLoadSync(url, context = kEmptyObject) {
171168
}
172169

173170
// Now that we have the source for the module, run `defaultGetFormat` to detect its format.
174-
format ??= defaultGetFormat(urlInstance, {
175-
__proto__: context,
176-
importAttributes,
177-
});
171+
format ??= defaultGetFormat(urlInstance, context);
178172

179173
// For backward compatibility reasons, we need to let go through Module._load
180174
// again.

0 commit comments

Comments
 (0)