diff options
author | 2021-07-24 15:00:08 -0700 | |
---|---|---|
committer | 2021-07-24 15:00:08 -0700 | |
commit | 796a9854b4a698b309a6e7a4c040047558858da6 (patch) | |
tree | 528b0161655ff705c8effc6cc617260043e7d6a7 /src/javascript/jsc/bindings/ZigGlobalObject.h | |
parent | 0d79861a94b446f9a1f5f776ee520301aa50f4fd (diff) | |
download | bun-796a9854b4a698b309a6e7a4c040047558858da6.tar.gz bun-796a9854b4a698b309a6e7a4c040047558858da6.tar.zst bun-796a9854b4a698b309a6e7a4c040047558858da6.zip |
wip
Diffstat (limited to 'src/javascript/jsc/bindings/ZigGlobalObject.h')
-rw-r--r-- | src/javascript/jsc/bindings/ZigGlobalObject.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.h b/src/javascript/jsc/bindings/ZigGlobalObject.h index 7436bc531..b7bf7e00b 100644 --- a/src/javascript/jsc/bindings/ZigGlobalObject.h +++ b/src/javascript/jsc/bindings/ZigGlobalObject.h @@ -1,3 +1,5 @@ +#include "root.h" + #pragma once namespace JSC { @@ -7,56 +9,56 @@ namespace JSC { } - +#include <JavaScriptCore/Structure.h> #include <JavaScriptCore/JSGlobalObject.h> +#include <JavaScriptCore/JSTypeInfo.h> +namespace Zig { +class GlobalObject final : public JSC::JSGlobalObject { + using Base = JSC::JSGlobalObject; -namespace Zig { - using namespace JSC; - -class GlobalObject final : public JSGlobalObject { public: - using Base = JSGlobalObject; DECLARE_EXPORT_INFO; - static const GlobalObjectMethodTable s_globalObjectMethodTable; + static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable; static constexpr bool needsDestruction = true; - template<typename CellType, SubspaceAccess mode> - static IsoSubspace* subspaceFor(VM& vm) + template<typename CellType, JSC::SubspaceAccess mode> + static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) { return vm.apiGlobalObjectSpace<mode>(); } - static GlobalObject* create(VM& vm, Structure* structure) + static GlobalObject* create(JSC::VM& vm, JSC::Structure* structure) { - auto* object = new (NotNull, allocateCell<GlobalObject>(vm.heap)) GlobalObject(vm, structure); + auto* object = new (NotNull, JSC::allocateCell<GlobalObject>(vm.heap)) GlobalObject(vm, structure); object->finishCreation(vm); return object; } - static Structure* createStructure(VM& vm, JSValue prototype) + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSValue prototype) { - auto* result = Structure::create(vm, nullptr, prototype, TypeInfo(GlobalObjectType, StructureFlags), info()); + auto* result = JSC::Structure::create(vm, nullptr, prototype, JSC::TypeInfo(JSC::GlobalObjectType, Base::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, JSValue); - + static void reportUncaughtExceptionAtEventLoop(JSGlobalObject*, JSC::Exception*); + static JSC::JSInternalPromise* moduleLoaderImportModule(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSString* moduleNameValue, JSC::JSValue parameters, const JSC::SourceOrigin&); + static JSC::Identifier moduleLoaderResolve(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue keyValue, JSC::JSValue referrerValue, JSC::JSValue); + static JSC::JSInternalPromise* moduleLoaderFetch(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue); + static JSC::JSObject* moduleLoaderCreateImportMetaProperties(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSModuleRecord*, JSC::JSValue); + static JSC::JSValue moduleLoaderEvaluate(JSGlobalObject*, JSC::JSModuleLoader*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue); + static void promiseRejectionTracker(JSGlobalObject*, JSC::JSPromise*, JSC::JSPromiseRejectionOperation); private: - GlobalObject(VM& vm, Structure* structure) - : Base(vm, structure, &s_globalObjectMethodTable) - { } + + GlobalObject(JSC::VM& vm, JSC::Structure* structure) + : JSC::JSGlobalObject(vm, structure, &s_globalObjectMethodTable) + { + } }; } |