aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-03-28 06:35:28 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-03-28 06:35:28 -0700
commite577e753a50fd6c64907d591bbb280923a8e5552 (patch)
tree998e9808105cb7afacce2b5fcba84c838930875a
parent04b5e87f42b9a04d7b106b8dc1d92b4f0d435d4f (diff)
downloadbun-e577e753a50fd6c64907d591bbb280923a8e5552.tar.gz
bun-e577e753a50fd6c64907d591bbb280923a8e5552.tar.zst
bun-e577e753a50fd6c64907d591bbb280923a8e5552.zip
ScriptExecutionContext
-rw-r--r--Makefile3
-rw-r--r--src/javascript/jsc/bindings/ZigGlobalObject.h26
2 files changed, 14 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index d54157383..01d09fc98 100644
--- a/Makefile
+++ b/Makefile
@@ -194,7 +194,8 @@ MAC_INCLUDE_DIRS := -I$(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders \
-I$(WEBKIT_RELEASE_DIR)/ \
-Isrc/javascript/jsc/bindings/ \
-Isrc/javascript/jsc/bindings/webcore \
- -I$(WEBKIT_DIR)/Source/bmalloc
+ -I$(WEBKIT_DIR)/Source/bmalloc \
+ -I$(WEBKIT_DIR)/Source
LINUX_INCLUDE_DIRS := -I$(JSC_INCLUDE_DIR) \
-Isrc/javascript/jsc/bindings/
diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.h b/src/javascript/jsc/bindings/ZigGlobalObject.h
index 8ac226220..721f2c032 100644
--- a/src/javascript/jsc/bindings/ZigGlobalObject.h
+++ b/src/javascript/jsc/bindings/ZigGlobalObject.h
@@ -6,6 +6,10 @@ class Identifier;
} // namespace JSC
+namespace WebCore {
+class ScriptExecutionContext;
+}
+
#include "root.h"
#include "headers-handwritten.h"
@@ -83,6 +87,9 @@ public:
bool worldIsNormal() const { return m_worldIsNormal; }
static ptrdiff_t offsetOfWorldIsNormal() { return OBJECT_OFFSETOF(GlobalObject, m_worldIsNormal); }
+ WebCore::ScriptExecutionContext* scriptExecutionContext();
+ WebCore::ScriptExecutionContext* scriptExecutionContext() const;
+
JSDOMStructureMap& structures() WTF_REQUIRES_LOCK(m_gcLock) { return m_structures; }
JSDOMStructureMap& structures(NoLockingNecessaryTag) WTF_IGNORES_THREAD_SAFETY_ANALYSIS
{
@@ -117,20 +124,12 @@ public:
void installAPIGlobals(JSClassRef* globals, int count, JSC::VM& vm);
private:
- GlobalObject(JSC::VM& vm, JSC::Structure* structure)
- : JSC::JSGlobalObject(vm, structure, &s_globalObjectMethodTable)
- , m_constructors(makeUnique<WebCore::DOMConstructors>())
- , m_world(WebCore::DOMWrapperWorld::create(vm, WebCore::DOMWrapperWorld::Type::Normal))
- , m_worldIsNormal(true)
- {
- }
-
-private:
+ GlobalObject(JSC::VM& vm, JSC::Structure* structure);
std::unique_ptr<WebCore::DOMConstructors> m_constructors;
uint8_t m_worldIsNormal;
JSDOMStructureMap m_structures WTF_GUARDED_BY_LOCK(m_gcLock);
Lock m_gcLock;
-
+ WebCore::ScriptExecutionContext* m_scriptExecutionContext;
Ref<WebCore::DOMWrapperWorld> m_world;
};
@@ -164,10 +163,9 @@ private:
} // namespace Zig
+#ifndef RENAMED_JSDOM_GLOBAL_OBJECT
+#define RENAMED_JSDOM_GLOBAL_OBJECT
namespace WebCore {
using JSDOMGlobalObject = Zig::GlobalObject;
}
-
-namespace WebCore {
-using JSDOMGlobalObject = Zig::GlobalObject;
-}
+#endif \ No newline at end of file