From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Keeley Hammond <khammond@slack-corp.com>
Date: Tue, 2 Aug 2022 12:52:02 -0700
Subject: fix: override createjob in node_platform

Refs https://github.com/nodejs/node/pull/44741/commits/507dd20ef957acf261ec521fcbd81d745b17983c

V8Platform::CreateJob was changed to an abstract method in https://chromium-review.googlesource.com/c/v8/v8/+/3779694,
and is called by V8Platform::PostJob, so we should only call
CreateJob in order to most closely match V8Platform default behavior.

This patch can be removed when Electron updates to Node.js v20.

diff --git a/src/node_platform.cc b/src/node_platform.cc
index 7dd0526e6ece5fd86ab3847be592e778e48b5d37..a20622adb2ee8a2e3b05b336e481193624d5b810 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -528,7 +528,7 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
   return per_isolate->FlushForegroundTasksInternal();
 }
 
-std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority,
+std::unique_ptr<v8::JobHandle> NodePlatform::CreateJob(v8::TaskPriority priority,
                                        std::unique_ptr<v8::JobTask> job_task) {
   return v8::platform::NewDefaultJobHandle(
       this, priority, std::move(job_task), NumberOfWorkerThreads());
diff --git a/src/node_platform.h b/src/node_platform.h
index 4a05f3bba58c8e875d0ab67f292589edbb3b812b..1062f3b1b9c386a7bde8dca366c6f008bb183ab7 100644
--- a/src/node_platform.h
+++ b/src/node_platform.h
@@ -155,7 +155,7 @@ class NodePlatform : public MultiIsolatePlatform {
   double CurrentClockTimeMillis() override;
   v8::TracingController* GetTracingController() override;
   bool FlushForegroundTasks(v8::Isolate* isolate) override;
-  std::unique_ptr<v8::JobHandle> PostJob(
+  std::unique_ptr<v8::JobHandle> CreateJob(
       v8::TaskPriority priority,
       std::unique_ptr<v8::JobTask> job_task) override;
 
