From 3860b922c7192a2e9b36edebf599a27746f56368 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sun, 23 Feb 2020 18:06:34 +0100 Subject: [PATCH] Some clean-ups --- src/Utilities.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Utilities.h b/src/Utilities.h index 999712c..036567b 100644 --- a/src/Utilities.h +++ b/src/Utilities.h @@ -4,17 +4,16 @@ #include using namespace v8; -/* Unfortunately we have to depend on Node.js garbage */ +/* Unfortunately we _have_ to depend on Node.js crap */ #include -/* This is a very hot function ruined by illiteracy */ MaybeLocal CallJS(Isolate *isolate, Local f, int argc, Local *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}); } }