Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: implement IsInsideNodeModules() in C++ #55286

Merged
merged 2 commits into from
Oct 8, 2024

Commits on Oct 7, 2024

  1. src: implement IsInsideNodeModules() in C++

    This previously compiles a script and run it in a new context
    to avoid global pollution, which is more complex than necessary
    and can be too slow for it to be reused in other cases. The
    new implementation just checks the frames in C++ which is safe
    from global pollution, faster and simpler.
    
    The previous implementation also had a bug when the call site
    is in a ESM, because ESM have URLs as their script names,
    which don't start with '/' or '\' and will be skipped. The new
    implementation removes the skipping to fix it for ESM.
    joyeecheung committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    eb8eba8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c5cfa9c View commit details
    Browse the repository at this point in the history