JSAPIGlobalObject.h [plain text]
#pragma once
#include "JSGlobalObject.h"
OBJC_CLASS JSScript;
namespace JSC {
class JSAPIGlobalObject final : public JSGlobalObject {
public:
using Base = JSGlobalObject;
DECLARE_EXPORT_INFO;
static const GlobalObjectMethodTable s_globalObjectMethodTable;
static constexpr bool needsDestruction = true;
template<typename CellType, SubspaceAccess mode>
static IsoSubspace* subspaceFor(VM& vm)
{
return vm.apiGlobalObjectSpace<mode>();
}
static JSAPIGlobalObject* create(VM& vm, Structure* structure)
{
auto* object = new (NotNull, allocateCell<JSAPIGlobalObject>(vm.heap)) JSAPIGlobalObject(vm, structure);
object->finishCreation(vm);
return object;
}
static Structure* createStructure(VM& vm, JSValue prototype)
{
auto* result = Structure::create(vm, nullptr, prototype, TypeInfo(GlobalObjectType, StructureFlags), info());
result->setTransitionWatchpointIsLikelyToBeFired(true);
return result;
}
static void reportUncaughtExceptionAtEventLoop(JSGlobalObject*, Exception*);
static JSInternalPromise* moduleLoaderImportModule(JSGlobalObject*, JSModuleLoader*, JSString* moduleNameValue, JSValue parameters, const SourceOrigin&);
static Identifier moduleLoaderResolve(JSGlobalObject*, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue);
static JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, JSModuleLoader*, JSValue, JSValue, JSValue);
static JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, JSModuleLoader*, JSValue, JSModuleRecord*, JSValue);
static JSValue moduleLoaderEvaluate(JSGlobalObject*, JSModuleLoader*, JSValue, JSValue, JSValue);
JSValue loadAndEvaluateJSScriptModule(const JSLockHolder&, JSScript *);
private:
JSAPIGlobalObject(VM& vm, Structure* structure)
: Base(vm, structure, &s_globalObjectMethodTable)
{ }
};
}