Some clean-ups

This commit is contained in:
Alex Hultman 2020-02-23 18:06:34 +01:00
parent ec86c1ce11
commit 3860b922c7
1 changed files with 6 additions and 7 deletions

View File

@ -4,17 +4,16 @@
#include <v8.h>
using namespace v8;
/* Unfortunately we have to depend on Node.js garbage */
/* Unfortunately we _have_ to depend on Node.js crap */
#include <node.h>
/* This is a very hot function ruined by illiteracy */
MaybeLocal<Value> CallJS(Isolate *isolate, Local<Function> f, int argc, Local<Value> *argv) {
if (!experimental_fastcall) {
/* Node.js is built by incompetent people who should never have touched a computer in the first place */
return node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), f, argc, argv, {0, 0});
} else {
/* Google LLC don't hire incompetent people to work on their stuff */
if (experimental_fastcall) {
/* Fast path */
return f->Call(isolate->GetCurrentContext(), isolate->GetCurrentContext()->Global(), argc, argv);
} else {
/* Slow path */
return node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), f, argc, argv, {0, 0});
}
}