Skip to content

Commit fbe9f0f

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 e07a196 commit fbe9f0f

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;
@@ -826,7 +827,8 @@ void Initialize(Local<Object> target,
826827
Local<Value> unused,
827828
Local<Context> context,
828829
void* priv) {
829-
Isolate* isolate = context->GetIsolate();
830+
Environment* env = Environment::GetCurrent(context);
831+
Isolate* isolate = env->isolate();
830832

831833
// Set boolean flags as properties (computed once, avoids repeated calls).
832834
bool is_sea = IsSingleExecutable();
@@ -838,8 +840,8 @@ void Initialize(Local<Object> target,
838840
SeaResource sea_resource = FindSingleExecutableResource();
839841
is_vfs_enabled =
840842
static_cast<bool>(sea_resource.flags & SeaFlags::kEnableVfs);
841-
if (!static_cast<bool>(
842-
sea_resource.flags & SeaFlags::kDisableExperimentalSeaWarning)) {
843+
if (!static_cast<bool>(sea_resource.flags &
844+
SeaFlags::kDisableExperimentalSeaWarning)) {
843845
is_experimental_warning_needed = true;
844846
}
845847
}

0 commit comments

Comments
 (0)