-
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 12.11.1 #58
Comments
Patches for NodeJS 12.11.1There are 5 patches, ...about line 8 #if defined(LEAK_SANITIZER)
#include <sanitizer/lsan_interface.h>
#endif
//////////////////////////////////
//#espresso ,#1
#include "../src/libespresso/bridge2.h"
void DoEngineSetupCallback(JsEngine* engine, JsContext* jsContext);
void DoEngineClosingCallback(JsEngine* engine,
JsContext* jsContext,
int exitCode);
//////////////////////////////////
namespace node {
using v8::Context;
using v8::HandleScope;
patch 1: src/node_main_instance.cc ...about line 113 int NodeMainInstance::Run() {
Locker locker(isolate_);
Isolate::Scope isolate_scope(isolate_);
HandleScope handle_scope(isolate_);
int exit_code = 0;
std::unique_ptr<Environment> env = CreateMainEnvironment(&exit_code);
CHECK_NOT_NULL(env);
Context::Scope context_scope(env->context());
if (exit_code == 0) {
////////////////////////////////
//#espresso ,#2
JsEngine* jsEngine = JsEngine::NewFromExistingIsolate(isolate_);
v8::Persistent<Context>* pcontext =
new v8::Persistent<Context>(isolate_, env->context());
JsContext* jscontext =
JsContext::NewFromExistingContext(0, jsEngine, pcontext);
DoEngineSetupCallback(jsEngine, jscontext);
////////////////////////////////
{
AsyncCallbackScope callback_scope(env.get());
env->async_hooks()->push_async_ids(1, 0);
LoadEnvironment(env.get());
env->async_hooks()->pop_async_id(1);
}
patch 2: src/node_main_instance.cc ...about line 162 env->set_trace_sync_io(false);
exit_code = EmitExit(env.get());
////////////////////////////////
//#espresso ,#3
DoEngineClosingCallback(jsEngine, jscontext, exit_code);
////////////////////////////////
WaitForInspectorDisconnect(env.get());
} patch 3: src/node_main_instance.cc |
... about line about line 725 Module._resolveFilename = function(request, parent, isMain, options) {
if (NativeModule.canBeRequiredByUsers(request)) {
return request;
}
////////////////////////////////////////////
//#espresso, #4
if (request.endsWith(".espr")) {
return request;
}
////////////////////////////////////////////
var paths;
patch4: lib/internal/modules/cjs/loader.js ... about line about line 989 // Native extension for .node
Module._extensions['.node'] = function(module, filename) {
if (manifest) {
const content = fs.readFileSync(filename);
const moduleURL = pathToFileURL(filename);
manifest.assertIntegrity(moduleURL, content);
}
// Be aware this doesn't use `content`
return process.dlopen(module, path.toNamespacedPath(filename));
};
//////////////////////////////////
//#espresso, #5
Module._extensions['.espr'] = function (module, filename) {
//this make node to callback to our module
var content = LibEspresso.LoadMainSrcFile();
module._compile(stripBOM(content), filename);
};
////////////////////////////////// patch5: lib/internal/modules/cjs/loader.js |
for x86 on Windows |
Bridge your C# soul to the power of Javascript (V8 Javascript Engine / NodeJs)
EspressoND, Http/2, NodeJS12.11.1
The text was updated successfully, but these errors were encountered: