From 99ebc3aa5c1da42e85fa3b58fa0ec1867fb7f935 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 11 Feb 2026 20:25:29 -0800 Subject: [PATCH] Fix build --- cmake/targets/BuildBun.cmake | 4 ++++ src/bun.js/bindings/webcore/JSEvent.cpp | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cmake/targets/BuildBun.cmake b/cmake/targets/BuildBun.cmake index bf661a670b..87b7ee59b8 100644 --- a/cmake/targets/BuildBun.cmake +++ b/cmake/targets/BuildBun.cmake @@ -546,6 +546,7 @@ set(BUN_OBJECT_LUT_SOURCES ${CWD}/src/bun.js/bindings/ProcessBindingHTTPParser.cpp ${CWD}/src/bun.js/modules/NodeModuleModule.cpp ${CODEGEN_PATH}/ZigGeneratedClasses.lut.txt + ${CWD}/src/bun.js/bindings/webcore/JSEvent.cpp ) set(BUN_OBJECT_LUT_OUTPUTS @@ -560,6 +561,7 @@ set(BUN_OBJECT_LUT_OUTPUTS ${CODEGEN_PATH}/ProcessBindingHTTPParser.lut.h ${CODEGEN_PATH}/NodeModuleModule.lut.h ${CODEGEN_PATH}/ZigGeneratedClasses.lut.h + ${CODEGEN_PATH}/JSEvent.lut.h ) macro(WEBKIT_ADD_SOURCE_DEPENDENCIES _source _deps) @@ -593,6 +595,7 @@ foreach(i RANGE 0 ${BUN_OBJECT_LUT_SOURCES_MAX_INDEX}) "Generating ${filename}.lut.h" DEPENDS ${BUN_OBJECT_LUT_SOURCE} + ${CWD}/src/codegen/create_hash_table COMMAND ${BUN_EXECUTABLE} ${BUN_FLAGS} @@ -602,6 +605,7 @@ foreach(i RANGE 0 ${BUN_OBJECT_LUT_SOURCES_MAX_INDEX}) ${BUN_OBJECT_LUT_OUTPUT} SOURCES ${BUN_OBJECT_LUT_SCRIPT} + ${CWD}/src/codegen/create_hash_table ${BUN_OBJECT_LUT_SOURCE} OUTPUTS ${BUN_OBJECT_LUT_OUTPUT} diff --git a/src/bun.js/bindings/webcore/JSEvent.cpp b/src/bun.js/bindings/webcore/JSEvent.cpp index 63ac7b031e..d06d327dd2 100644 --- a/src/bun.js/bindings/webcore/JSEvent.cpp +++ b/src/bun.js/bindings/webcore/JSEvent.cpp @@ -122,16 +122,18 @@ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSEventPrototype, JSEventPrototype::Base); using JSEventDOMConstructor = JSDOMConstructor; -/* Hash table */ +/* Source for JSEvent.lut.h +@begin JSEventTable +isTrusted jsEvent_isTrusted DontDelete|ReadOnly|CustomAccessor|DOMAttribute +@end +*/ -static const struct CompactHashIndex JSEventTableIndex[2] = { - { 0, -1 }, - { -1, -1 }, -}; - -static const HashTableValue JSEventTableValues[] = { - { "isTrusted"_s, static_cast(JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, jsEvent_isTrusted, 0 } }, -}; +// The generated .lut.h defines JSEventTable with nullptr for classForThis, +// but DOMAttribute properties require it for type checking. Rename the +// generated table and redefine it with the correct classForThis. +#define JSEventTable JSEventTable_GENERATED +#include "JSEvent.lut.h" +#undef JSEventTable static const HashTable JSEventTable = { 1, 1, true, JSEvent::info(), JSEventTableValues, JSEventTableIndex }; /* Hash table for constructor */