Skip to content

Commit d08c61f

Browse files
committed
fixup! src: use cppgc to manage ContextifyContext
1 parent a4ef690 commit d08c61f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/node_contextify.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ContextifyContext* ContextifyContext::New(Environment* env,
141141
if (!(CreateV8Context(env->isolate(), object_template, snapshot_data, queue)
142142
.ToLocal(&v8_context))) {
143143
// Allocation failure, maximum call stack size reached, termination, etc.
144-
return nullptr;
144+
return {};
145145
}
146146
return New(v8_context, env, sandbox_obj, options);
147147
}
@@ -254,7 +254,7 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
254254
// things down significantly and they are only needed in rare occasions
255255
// in the vm contexts.
256256
if (InitializeContextRuntime(v8_context).IsNothing()) {
257-
return nullptr;
257+
return {};
258258
}
259259

260260
Local<Context> main_context = env->context();
@@ -306,7 +306,7 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
306306
ctor_name,
307307
static_cast<v8::PropertyAttribute>(v8::DontEnum))
308308
.IsNothing()) {
309-
return nullptr;
309+
return {};
310310
}
311311
}
312312

@@ -319,15 +319,15 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
319319
env->host_defined_option_symbol(),
320320
options->host_defined_options_id)
321321
.IsNothing()) {
322-
return nullptr;
322+
return {};
323323
}
324324

325325
env->AssignToContext(v8_context, nullptr, info);
326326

327327
if (!env->contextify_wrapper_template()
328328
->NewInstance(v8_context)
329329
.ToLocal(&wrapper)) {
330-
return nullptr;
330+
return {};
331331
}
332332

333333
result = cppgc::MakeGarbageCollected<ContextifyContext>(
@@ -345,7 +345,7 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
345345
->SetPrivate(
346346
v8_context, env->contextify_context_private_symbol(), wrapper)
347347
.IsNothing()) {
348-
return nullptr;
348+
return {};
349349
}
350350

351351
// Assign host_defined_options_id to the sandbox object or the global object
@@ -357,7 +357,7 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
357357
env->host_defined_option_symbol(),
358358
options->host_defined_options_id)
359359
.IsNothing()) {
360-
return nullptr;
360+
return {};
361361
}
362362
return result;
363363
}

src/node_contextify.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

66
#include "base_object-inl.h"
7-
#include "cppgc/prefinalizer.h"
87
#include "cppgc_helpers.h"
98
#include "node_context_data.h"
109
#include "node_errors.h"

0 commit comments

Comments
 (0)