Skip to content

Commit 4f8e6de

Browse files
committed
sea: fix C++ compilation errors in Initialize
Use Environment::GetCurrent(context) instead of context->GetIsolate(), add missing using v8::Boolean declaration, and fix clang-format style.
1 parent 16a17ae commit 4f8e6de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/node_sea.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using node::ExitCode;
2323
using v8::Array;
2424
using v8::ArrayBuffer;
2525
using v8::BackingStore;
26+
using v8::Boolean;
2627
using v8::Context;
2728
using v8::Function;
2829
using v8::FunctionCallbackInfo;
@@ -879,7 +880,8 @@ void Initialize(Local<Object> target,
879880
Local<Value> unused,
880881
Local<Context> context,
881882
void* priv) {
882-
Isolate* isolate = context->GetIsolate();
883+
Environment* env = Environment::GetCurrent(context);
884+
Isolate* isolate = env->isolate();
883885

884886
// Set boolean flags as properties (computed once, avoids repeated calls).
885887
bool is_sea = IsSingleExecutable();
@@ -891,8 +893,8 @@ void Initialize(Local<Object> target,
891893
SeaResource sea_resource = FindSingleExecutableResource();
892894
is_vfs_enabled =
893895
static_cast<bool>(sea_resource.flags & SeaFlags::kEnableVfs);
894-
if (!static_cast<bool>(
895-
sea_resource.flags & SeaFlags::kDisableExperimentalSeaWarning)) {
896+
if (!static_cast<bool>(sea_resource.flags &
897+
SeaFlags::kDisableExperimentalSeaWarning)) {
896898
is_experimental_warning_needed = true;
897899
}
898900
}

0 commit comments

Comments
 (0)