Skip to content

Commit

Permalink
Review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Dec 15, 2022
1 parent 0b79ed3 commit ca876ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/internal/modules/esm/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const {
ArrayPrototypePush,
FunctionPrototypeCall,
ObjectAssign,
ObjectCreate,
ObjectDefineProperty,
ObjectSetPrototypeOf,
SafeSet,
Expand Down Expand Up @@ -255,7 +254,7 @@ class Hooks {
async resolve(
originalSpecifier,
parentURL,
importAssertions = ObjectCreate(null),
importAssertions = { __proto__: null },
) {
const isMain = parentURL === undefined;

Expand Down Expand Up @@ -522,7 +521,7 @@ function pluckHooks({
transformSource,
}) {
const obsoleteHooks = [];
const acceptedHooks = ObjectCreate(null);
const acceptedHooks = { __proto__: null };

if (getGlobalPreloadCode) {
globalPreload ??= getGlobalPreloadCode;
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function getSource(url, context) {
* @param {object} context
* @returns {object}
*/
async function defaultLoad(url, context) {
async function defaultLoad(url, context = {}) {
let responseURL = url;
const { importAssertions } = context;
let {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class ESMLoader {
* @param {object} context Metadata about the module
* @returns {Promise<{ format: ModuleFormat, source: ModuleSource }>}
*/
async load(url, context = {}) {
async load(url, context) {
let loadResult;
if (this.#hooks) {
loadResult = await this.#hooks.load(url, context);
Expand Down

0 comments on commit ca876ad

Please sign in to comment.