Skip to content

Running node parses the entry file path 5 times #49968

Open
@anonrig

Description

@anonrig

Follow the following steps:

  1. touch buggy-bug.mjs
  2. Update lib/internal/url.js and add a console.log to URL class constructor
  3. Run the script with out/Release/node buggy-bug.mjs

Output:

➜  node git:(main) ✗ out/Release/node buggy-bug.mjs
{
  input: 'file:///Users/yagiz/Developer/node/buggy-bug.mjs',
  base: undefined
}
{
  input: 'file:///Users/yagiz/Developer/node/buggy-bug.mjs',
  base: undefined
}
{ input: 'file:///Users/yagiz/Developer/node/', base: undefined }
{
  input: 'file:///Users/yagiz/Developer/node/buggy-bug.mjs',
  base: undefined
}
{
  input: 'file:///Users/yagiz/Developer/node/buggy-bug.mjs',
  base: undefined
}
{
  input: 'file:///Users/yagiz/Developer/node/buggy-bug.mjs',
  base: undefined
}

cc @nodejs/loaders @nodejs/performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.loadersIssues and PRs related to ES module loadersperformanceIssues and PRs related to the performance of Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions