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: use NativeModuleLoader to compile per_context.js #24660

Closed
wants to merge 2 commits into from

Commits on Nov 26, 2018

  1. src: use NativeModuleLoader to compile per_context.js

    This patch introduces a NativeModuleLoader::CompileAndCall that
    can run a JS script under `lib/` as a function called
    with a null receiver and arguments specified from the C++ layer.
    Since all our bootstrappers are wrapped in functions in the
    source to avoid leaking variables into the global scope anyway,
    this allows us to remove that extra indentation in the JS source code.
    
    As a start we move the compilation and execution of per_context.js
    to NativeModuleLoader::CompileAndCall(). This patch also changes the return
    value of NativeModuleLoader::LookupAndCompile() to a MaybeLocal
    since the caller has to take care of the result being empty
    anyway.
    
    This patch reverts the previous design of having the
    NativeModuleLoader::Compile() method magically know about the
    parameters of the function - until we have tooling
    in-place to guess the parameter names in the source with some
    annotation, it's more readable to allow the caller to specify
    the parameters along with the arguments values.
    joyeecheung committed Nov 26, 2018
    Configuration menu
    Copy the full SHA
    2a84b8d View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2018

  1. Configuration menu
    Copy the full SHA
    9151e7a View commit details
    Browse the repository at this point in the history