#include "include/v8-function.h"
#include "src/flags/flags.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
using ModuleTest = v8::TestWithContext;
Context;
Data;
FixedArray;
HandleScope;
Int32;
Isolate;
Local;
Location;
MaybeLocal;
Module;
ModuleRequest;
Promise;
ScriptCompiler;
ScriptOrigin;
String;
Value;
ScriptOrigin ModuleOrigin(Local<v8::Value> resource_name, Isolate* isolate) { … }
static v8::Global<Module> dep1_global;
static v8::Global<Module> dep2_global;
MaybeLocal<Module> ResolveCallback(Local<Context> context,
Local<String> specifier,
Local<FixedArray> import_attributes,
Local<Module> referrer) { … }
TEST_F(ModuleTest, ModuleInstantiationFailures1) { … }
static v8::Global<Module> fooModule_global;
static v8::Global<Module> barModule_global;
MaybeLocal<Module> ResolveCallbackWithImportAttributes(
Local<Context> context, Local<String> specifier,
Local<FixedArray> import_attributes, Local<Module> referrer) { … }
TEST_F(ModuleTest, ModuleInstantiationWithImportAssertions) { … }
TEST_F(ModuleTest, ModuleInstantiationFailures2) { … }
static MaybeLocal<Module> CompileSpecifierAsModuleResolveCallback(
Local<Context> context, Local<String> specifier,
Local<FixedArray> import_attributes, Local<Module> referrer) { … }
TEST_F(ModuleTest, ModuleEvaluation) { … }
TEST_F(ModuleTest, ModuleEvaluationError1) { … }
static v8::Global<Module> failure_module_global;
static v8::Global<Module> dependent_module_global;
MaybeLocal<Module> ResolveCallbackForModuleEvaluationError2(
Local<Context> context, Local<String> specifier,
Local<FixedArray> import_attributes, Local<Module> referrer) { … }
TEST_F(ModuleTest, ModuleEvaluationError2) { … }
TEST_F(ModuleTest, ModuleEvaluationCompletion1) { … }
TEST_F(ModuleTest, ModuleEvaluationCompletion2) { … }
TEST_F(ModuleTest, ModuleNamespace) { … }
TEST_F(ModuleTest, ModuleEvaluationTopLevelAwait) { … }
TEST_F(ModuleTest, ModuleEvaluationTopLevelAwaitError) { … }
namespace {
struct DynamicImportData { … };
void DoHostImportModuleDynamically(void* import_data) { … }
v8::MaybeLocal<v8::Promise> HostImportModuleDynamicallyCallbackResolve(
Local<Context> context, Local<Data> host_defined_options,
Local<Value> resource_name, Local<String> specifier,
Local<FixedArray> import_attributes) { … }
v8::MaybeLocal<v8::Promise> HostImportModuleDynamicallyCallbackReject(
Local<Context> context, Local<Data> host_defined_options,
Local<Value> resource_name, Local<String> specifier,
Local<FixedArray> import_attributes) { … }
}
TEST_F(ModuleTest, ModuleEvaluationTopLevelAwaitDynamicImport) { … }
TEST_F(ModuleTest, ModuleEvaluationTopLevelAwaitDynamicImportError) { … }
TEST_F(ModuleTest, TerminateExecutionTopLevelAwaitSync) { … }
TEST_F(ModuleTest, TerminateExecutionTopLevelAwaitAsync) { … }
static v8::Global<Module> async_leaf_module_global;
static v8::Global<Module> sync_leaf_module_global;
static v8::Global<Module> cycle_self_module_global;
static v8::Global<Module> cycle_one_module_global;
static v8::Global<Module> cycle_two_module_global;
MaybeLocal<Module> ResolveCallbackForIsGraphAsyncTopLevelAwait(
Local<Context> context, Local<String> specifier,
Local<FixedArray> import_attributes, Local<Module> referrer) { … }
TEST_F(ModuleTest, IsGraphAsyncTopLevelAwait) { … }
TEST_F(ModuleTest, AsyncEvaluatingInEvaluateEntryPoint) { … }
}