diff options
author | 2023-10-04 21:29:35 -0700 | |
---|---|---|
committer | 2023-10-04 21:29:35 -0700 | |
commit | b0ffe686757d5b51744e1b1af41afbc16581ca1b (patch) | |
tree | 88ec0fbc0bbc751d62f7f67b40359c340c6c2c28 /src/bun.js/bindings/bindings.cpp | |
parent | 5da79a8366e74e921dbf752ba2a33b4308170b48 (diff) | |
download | bun-b0ffe686757d5b51744e1b1af41afbc16581ca1b.tar.gz bun-b0ffe686757d5b51744e1b1af41afbc16581ca1b.tar.zst bun-b0ffe686757d5b51744e1b1af41afbc16581ca1b.zip |
Create `AbortSignal` without JS (#6278)
* Create `AbortSignal` without JS
* Don't leak
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/bindings.cpp')
-rw-r--r-- | src/bun.js/bindings/bindings.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 1e0d1c97e..9ba053a23 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -4534,6 +4534,14 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskJob(JSC__JSGlobalObject* arg0 JSC::JSValue::decode(JSValue4)); } +extern "C" WebCore::AbortSignal* WebCore__AbortSignal__new(JSC__JSGlobalObject* globalObject) +{ + Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(globalObject); + auto* context = thisObject->scriptExecutionContext(); + RefPtr<WebCore::AbortSignal> abortSignal = WebCore::AbortSignal::create(context); + return abortSignal.leakRef(); +} + extern "C" JSC__JSValue WebCore__AbortSignal__create(JSC__JSGlobalObject* globalObject) { Zig::GlobalObject* thisObject = JSC::jsCast<Zig::GlobalObject*>(globalObject); |