diff --git a/src/bun.js/bindings/webcore/JSEventEmitter.cpp b/src/bun.js/bindings/webcore/JSEventEmitter.cpp index 5e877c7383..e095ec5175 100644 --- a/src/bun.js/bindings/webcore/JSEventEmitter.cpp +++ b/src/bun.js/bindings/webcore/JSEventEmitter.cpp @@ -148,8 +148,8 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSEventEmitterDOMConstru if constexpr (IsExceptionOr) { RETURN_IF_EXCEPTION(throwScope, {}); } - Structure* structure = getDOMStructure(vm, globalObject) - JSEventEmitter* instance + Structure* structure = JSEventEmitter::createStructure(vm, lexicalGlobalObject, jsValue); + JSEventEmitter* instance = JSEventEmitter::create(structure, reinterpret_cast(lexicalGlobalObject), object.copyRef()); RETURN_IF_EXCEPTION(throwScope, {}); RELEASE_AND_RETURN(throwScope, JSValue::encode(instance));