diff --git a/lib/internal/main/embedding.js b/lib/internal/main/embedding.js index 313ecb2bec7bf4..63676385b14e8c 100644 --- a/lib/internal/main/embedding.js +++ b/lib/internal/main/embedding.js @@ -3,7 +3,7 @@ const { prepareMainThreadExecution, markBootstrapComplete, } = require('internal/process/pre_execution'); -const { isExperimentalSeaWarningDisabled, isSea } = internalBinding('sea'); +const { isExperimentalSeaWarningNeeded } = internalBinding('sea'); const { emitExperimentalWarning } = require('internal/util'); const { embedderRequire, embedderRunCjs } = require('internal/util/embedding'); const { getEmbedderEntryFunction } = internalBinding('mksnapshot'); @@ -11,7 +11,7 @@ const { getEmbedderEntryFunction } = internalBinding('mksnapshot'); prepareMainThreadExecution(false, true); markBootstrapComplete(); -if (isSea() && !isExperimentalSeaWarningDisabled()) { +if (isExperimentalSeaWarningNeeded()) { emitExperimentalWarning('Single executable application'); } diff --git a/src/node_sea.cc b/src/node_sea.cc index 8e73f5c327856e..1853ef531a1a8b 100644 --- a/src/node_sea.cc +++ b/src/node_sea.cc @@ -105,13 +105,9 @@ bool IsSingleExecutable() { return postject_has_resource(); } -void IsSingleExecutable(const FunctionCallbackInfo& args) { - args.GetReturnValue().Set(IsSingleExecutable()); -} - -void IsExperimentalSeaWarningDisabled(const FunctionCallbackInfo& args) { +void IsExperimentalSeaWarningNeeded(const FunctionCallbackInfo& args) { SeaResource sea_resource = FindSingleExecutableResource(); - args.GetReturnValue().Set(static_cast( + args.GetReturnValue().Set(!static_cast( sea_resource.flags & SeaFlags::kDisableExperimentalSeaWarning)); } @@ -243,16 +239,14 @@ void Initialize(Local target, Local unused, Local context, void* priv) { - SetMethod(context, target, "isSea", IsSingleExecutable); SetMethod(context, target, - "isExperimentalSeaWarningDisabled", - IsExperimentalSeaWarningDisabled); + "isExperimentalSeaWarningNeeded", + IsExperimentalSeaWarningNeeded); } void RegisterExternalReferences(ExternalReferenceRegistry* registry) { - registry->Register(IsSingleExecutable); - registry->Register(IsExperimentalSeaWarningDisabled); + registry->Register(IsExperimentalSeaWarningNeeded); } } // namespace sea