// Copyright 2021 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef INCLUDE_V8_SCRIPT_H_ #define INCLUDE_V8_SCRIPT_H_ #include #include #include #include #include #include "v8-callbacks.h" // NOLINT(build/include_directory) #include "v8-data.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8-maybe.h" // NOLINT(build/include_directory) #include "v8-message.h" // NOLINT(build/include_directory) #include "v8config.h" // NOLINT(build/include_directory) namespace v8 { class Function; class Message; class Object; class PrimitiveArray; class Script; namespace internal { class BackgroundDeserializeTask; struct ScriptStreamingData; } // namespace internal /** * A container type that holds relevant metadata for module loading. * * This is passed back to the embedder as part of * HostImportModuleDynamicallyCallback for module loading. */ class V8_EXPORT ScriptOrModule { public: /** * The name that was passed by the embedder as ResourceName to the * ScriptOrigin. This can be either a v8::String or v8::Undefined. */ Local GetResourceName(); /** * The options that were passed by the embedder as HostDefinedOptions to * the ScriptOrigin. */ Local HostDefinedOptions(); }; /** * A compiled JavaScript script, not yet tied to a Context. */ class V8_EXPORT UnboundScript : public Data { public: /** * Binds the script to the currently entered context. */ Local