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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 5, 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 5, 2024
    Configuration menu
    Copy the full SHA
    d0d6f97 View commit details
    Browse the repository at this point in the history