Skip to content

Commit

Permalink
WIP: nuke EventSource as it doesn't work anyway (#14421)
Browse files Browse the repository at this point in the history
  • Loading branch information
190n authored Oct 15, 2024
1 parent fef9555 commit 035f97b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 189 deletions.
8 changes: 0 additions & 8 deletions packages/bun-types/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1838,14 +1838,6 @@ declare global {
withCredentials?: boolean;
}

interface EventSource extends Bun.EventSource {}
var EventSource: typeof globalThis extends {
onerror: any;
EventSource: infer T;
}
? T
: EventSource;

interface PromiseConstructor {
/**
* Create a deferred promise, with exposed `resolve` and `reject` methods which can be called
Expand Down
4 changes: 0 additions & 4 deletions packages/bun-types/test/globals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ const writableStream = new WritableStream();
const a = new ResolveError();
a.level;
}
{
const a = new EventSource("asdf");
a.CLOSED;
}
{
const a = new AbortController();
a;
Expand Down
24 changes: 0 additions & 24 deletions src/bun.js/bindings/ZigGlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3331,30 +3331,6 @@ JSC_DEFINE_HOST_FUNCTION(functionSetImmediate,
return Bun__Timer__setImmediate(globalObject, JSC::JSValue::encode(job), JSValue::encode(arguments));
}

JSValue getEventSourceConstructor(VM& vm, JSObject* thisObject)
{
auto globalObject = jsCast<Zig::GlobalObject*>(thisObject);
auto scope = DECLARE_THROW_SCOPE(vm);

JSC::JSFunction* getSourceEvent = JSC::JSFunction::create(vm, globalObject, eventSourceGetEventSourceCodeGenerator(vm), globalObject);
RETURN_IF_EXCEPTION(scope, {});

JSC::MarkedArgumentBuffer args;

JSC::CallData callData = JSC::getCallData(getSourceEvent);

NakedPtr<JSC::Exception> returnedException = nullptr;
auto result = JSC::call(globalObject, getSourceEvent, callData, globalObject->globalThis(), args, returnedException);
RETURN_IF_EXCEPTION(scope, {});

if (returnedException) {
throwException(globalObject, scope, returnedException.get());
return jsUndefined();
}

RELEASE_AND_RETURN(scope, result);
}

// `console.Console` or `import { Console } from 'console';`
JSC_DEFINE_CUSTOM_GETTER(getConsoleConstructor, (JSGlobalObject * globalObject, EncodedJSValue thisValue, PropertyName property))
{
Expand Down
1 change: 0 additions & 1 deletion src/bun.js/bindings/ZigGlobalObject.lut.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
structuredClone functionStructuredClone Function 2

global GlobalObject_getGlobalThis PropertyCallback
EventSource getEventSourceConstructor PropertyCallback

Bun GlobalObject::m_bunObject CellProperty|DontDelete|ReadOnly
File GlobalObject::m_JSDOMFileConstructor CellProperty
Expand Down
152 changes: 0 additions & 152 deletions test/js/bun/eventsource/eventsource.test.ts

This file was deleted.

0 comments on commit 035f97b

Please sign in to comment.