@@ -250,10 +250,6 @@ bool SeaResource::use_code_cache() const {
250250 return static_cast <bool >(flags & SeaFlags::kUseCodeCache );
251251}
252252
253- bool SeaResource::use_vfs_archive () const {
254- return static_cast <bool >(flags & SeaFlags::kVfsArchive );
255- }
256-
257253const SeaResource& FindSingleExecutableResource () {
258254 static const SeaResource sea_resource = []() -> SeaResource {
259255 std::string_view blob = FindSingleExecutableBlob ();
@@ -281,8 +277,12 @@ void IsVfsEnabled(const FunctionCallbackInfo<Value>& args) {
281277}
282278
283279void IsVfsArchiveEnabled (const FunctionCallbackInfo<Value>& args) {
284- args.GetReturnValue ().Set (IsSingleExecutable () &&
285- FindSingleExecutableResource ().use_vfs_archive ());
280+ bool enabled = false ;
281+ if (IsSingleExecutable ()) {
282+ const SeaResource& sea_resource = FindSingleExecutableResource ();
283+ enabled = static_cast <bool >(sea_resource.flags & SeaFlags::kVfsArchive );
284+ }
285+ args.GetReturnValue ().Set (enabled);
286286}
287287
288288void IsExperimentalSeaWarningNeeded (const FunctionCallbackInfo<Value>& args) {
@@ -636,15 +636,6 @@ std::optional<SeaConfig> ParseSingleExecutableConfig(
636636 config_path);
637637 return std::nullopt ;
638638 }
639- // The archive takes the mount point reserved for the --vfs-load source.
640- for (const std::string& arg : result.exec_argv ) {
641- if (arg == " --vfs-load" || arg.starts_with (" --vfs-load=" )) {
642- FPrintF (stderr,
643- " \" vfsArchive\" cannot be used together with --vfs-load in "
644- " \" execArgv\"\n " );
645- return std::nullopt ;
646- }
647- }
648639 // The archive is embedded as a single reserved asset.
649640 result.flags |= SeaFlags::kIncludeAssets ;
650641 }
@@ -975,20 +966,6 @@ void GetAssetKeys(const FunctionCallbackInfo<Value>& args) {
975966 args.GetReturnValue ().Set (result);
976967}
977968
978- // A worker has no main script handed to it, but places the SEA main script in
979- // its virtual file system just as the main thread does.
980- void GetMainCode (const FunctionCallbackInfo<Value>& args) {
981- CHECK_EQ (args.Length (), 0 );
982- const SeaResource& sea_resource = FindSingleExecutableResource ();
983- CHECK (!sea_resource.use_snapshot ());
984- Local<Value> code;
985- if (ToV8Value (args.GetIsolate ()->GetCurrentContext (),
986- sea_resource.main_code_or_snapshot )
987- .ToLocal (&code)) {
988- args.GetReturnValue ().Set (code);
989- }
990- }
991-
992969MaybeLocal<Value> LoadSingleExecutableApplication (
993970 const StartExecutionCallbackInfoWithModule& info) {
994971 // Here we are currently relying on the fact that in NodeMainInstance::Run(),
@@ -1071,7 +1048,6 @@ void Initialize(Local<Object> target,
10711048 IsExperimentalSeaWarningNeeded);
10721049 SetMethod (context, target, " getAsset" , GetAsset);
10731050 SetMethod (context, target, " getAssetKeys" , GetAssetKeys);
1074- SetMethod (context, target, " getMainCode" , GetMainCode);
10751051}
10761052
10771053void RegisterExternalReferences (ExternalReferenceRegistry* registry) {
@@ -1081,7 +1057,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
10811057 registry->Register (IsExperimentalSeaWarningNeeded);
10821058 registry->Register (GetAsset);
10831059 registry->Register (GetAssetKeys);
1084- registry->Register (GetMainCode);
10851060}
10861061
10871062} // namespace sea
0 commit comments