feat(fetch) AbortSignal (#2019)

* add fetch abort signal

* get aborted (still segfaults)

* bidings.zig u0 error

* still GC/memory error

* fix start crash

* fix AbortSignal fromJS

* change fromJS to obj.as

* addAbortSignalEventListenner

* handle abort types, and add tests

* fix tests

* add custom reason test

* merge 2 substring methods, use MAKE_STATIC_STRING_IMPL

* fix create AbortError and TimeoutError, move globalThis and exception creation to main thread

* fix tests and rebuild headers

* no need to check with substring reason is already an exception

* no need to check with substring reason is already an exception

* fix dumb error inverting conditions for check reason

* fix custom reason behavior
This commit is contained in:
Ciro Spaciari
2023-02-15 19:20:40 -03:00
committed by GitHub
parent 1c221d33b0
commit 597053ea91
17 changed files with 443 additions and 58 deletions

View File

@@ -1150,7 +1150,7 @@ pub const VirtualMachine = struct {
const after_namespace = if (namespace.len == 0)
specifier
else
specifier.substring(namespace.len + 1);
specifier.substring(namespace.len + 1, specifier.len);
if (plugin_runner.onResolveJSC(ZigString.init(namespace), after_namespace, source, .bun)) |resolved_path| {
res.* = resolved_path;