-
Notifications
You must be signed in to change notification settings - Fork 11
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
Espresso, NodeJS 16.8.0 #61
Comments
/lib/internal/modules/cjs/loader.js about line 848 Module._resolveFilename = function(request, parent, isMain, options) {
if (StringPrototypeStartsWith(request, 'node:') ||
NativeModule.canBeRequiredByUsers(request)) {
return request;
}
////////////////////////////////////////////
//#espresso, #4
if (request.endsWith(".espr")) {
return request;
}
//////////////////////////////////////////// patch 4: /lib/internal/modules/cjs/loader.js about line 1172 //////////////////////////////////
//#espresso, #5
Module._extensions['.espr'] = function (module, filename) {
//this make node to callback to our module
var content = LibEspresso.LoadMainSrcFile();
module._compile(content, filename);
};
//////////////////////////////////
// Native extension for .json
Module._extensions['.json'] = function(module, filename) {
const content = fs.readFileSync(filename, 'utf8');
if (policy?.manifest) {
const moduleURL = pathToFileURL(filename);
policy.manifest.assertIntegrity(moduleURL, content);
} patch 5: /lib/internal/modules/cjs/loader.js |
file /lib/internal/main/run_main_module.js markBootstrapComplete();
//////////////////////////////////
//#espresso, #6
/////////////////////////////////
if (typeof LibEspresso !== 'undefined') {
//we use our lib espr LibEspresso
require('internal/modules/cjs/loader').Module.runMain("hello.espr");
return;
}
///////////////////////////////// patch 6: /lib/internal/main/run_main_module.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
file src/node_main_instance.cc
about line 14
patch 1: src/node_main_instance.cc
about line 151
patch 2&3: src/node_main_instance.cc
The text was updated successfully, but these errors were encountered: