aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-04-07fix(node:events): correct `node:events.once`, add testsderrick/fix/event-emitter-async-iterGravatar Derrick Farris 4-57/+2
2023-04-06feat(node:events): finish `EE.AsyncIterator` and `node:events.on()`, add ↵Gravatar Derrick Farris 2-2/+2
some tests
2023-04-06wip(node:events): get async iter working, work through test flakinessGravatar Derrick Farris 2-2/+2
2023-04-06wip(node:events): fix `node:events.on` async iter to specGravatar Derrick Farris 3-28/+28
2023-04-06Fix `toEqual` when the second array has extra array holes (#2580)Gravatar Dylan Conway 1-9/+25
* iterate through remaining indexes, keep prop identifier * tests * format
2023-04-06Add last modify field "mtime" for FileBlob (#1431) (#2491)Gravatar Zhongwei Yao 2-0/+20
* Add lastModified field for FileBlob (#1431) lastModified value is epoch timestamp in millisecond unit. * update according to review comment.
2023-04-05fix `deepEquals` with array holes and accessors (#2557)Gravatar Dylan Conway 1-10/+20
* `deepEqual` handles slow array indexes * another test * oops * remove bad test * compare indexes in non-strict mode * more tests
2023-04-04Implement `import.meta.main` (#2556)Gravatar Jarred Sumner 1-2/+9
* Implement `import.meta.main` * Update main-test-1.js * Update fs.test.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-04Dylan/fix some failing tests (#2544)Gravatar Jarred Sumner 2-5/+34
* handle `umask()` invalid arguments * move `bktree-fast` to test root, fix postinstall * fix fs test * could be baseline * handle different timezones * accidentally deleted tests * fix hang in `AbortSignal.timeout` * bring abort tests back * Revert "bring abort tests back" This reverts commit 0ff2ad5bf408694ac719b8ba0a38b16070e10201. * bunx node-gyp * bun x * fix typecheck * test * Update inspect.test.js --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-04-01Add stubs for missing node builtins (#2534)Gravatar Jarred Sumner 1-13/+5
* Stub `node:v8` * Stub `node:trace_events` * Stub `node:repl` * Stub `node:inspector` * Stub `node:http2` * Stub `node:diagnostics_channel` * Stub `node:dgram` * Stub `node:cluster` * Link stubs * cleanup * Clean up the test * Implement `node:vm` stub * Cleanup `v8` module stub * Add missing `promises` export to node:stream * Implement `node:stream/promise` * Implement `node:assert/strict` * cleanup * better errors * Increaase timeout * Update inspector.exports.js * Make the version consistent * Implement `process.binding("constants")` * Update runner.node.mjs --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-29Fix date format (#2422) (#2474)Gravatar Adrien Zinger 1-1/+4
* Fix date format (#2422) * Add unit tests for #2422
2023-03-28More bug fixes (#2486)Gravatar Jarred Sumner 9-21/+54
* readline_promises test fix * fix `escapeHTML` for baseline builds * fs test fixes, use `tmpdir()` * add paths for `resolve.test.js` * isError with toString symbol and error prototype * comment about `toString` * skip async macro transform * test cleanup, skip stack format test * readline undo and redo fix * capture error from readline keypress * Update tcp-server.test.ts * use `removefileat` for recursive rmdir * use strong for `signal.reason` * initialize `m_flags` * directory with file fs test * recursive option * import expect * could be less than * move abort signal tests to another process * fix typecheck --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-03-22A couple bug fixes (#2458)Gravatar Dylan Conway 8-31/+34
* fix valid status code range * update path * highwatermark option * throw DOMException * remove extra transpiler output * more transpiler tests * comment * get index not quickly * replace with `getDirectIndex` * update abort test * throw out of range status code * promisify test fix * move stdio test instance files * working crypto tests * allow duplicate set-cookie headers * different formatting * revert, fix will be in different pr * it is called * use min buffer size * fix url tests * null origin for other protocols * remove overload * add very large file test * await * coerce to int64 * 64 * no cast * add todo blob url tests * use `tryConvertToInt52`
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 5-6/+110
* Fix test * Fix segfault when unexpected type is passed in `expect().toThrow` * Fix issues with request constructor * Don't bother cloning headers when its empty * woops * more tests * fix incorrect test * Make the fetch error messages better * Update response.zig * Fix test that failed on macOS * Fix test * Remove extra hash table lookups * Support running dummy registry directly cc @alexlamsl * Update test * Update test * fixup * Workaround crash in test runner * Fixup test * Fixup test * Update os.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-17Fix various fetch/response/request tests (#2416)Gravatar Dylan Conway 8-23/+139
* fix most fetch tests, skip a few * fastGet, toValueGC, and invalid init * bigint unreachable, range error, log process as process * remove extra fetch_headers * remove js_type parameter, check isObject() * throw invalid mime type error, use enum literal * switch back to promise rejection * RangeError pascal case
2023-03-17Feat(test): add toMatch (#2404)Gravatar zhiyuan 5-2/+41
2023-03-15feat(expect): update toBeInstanceOf (#2396)Gravatar zhiyuan 5-3/+27
* feat: update instanceof binding * fix: according to PR comments
2023-03-15Fixes #2399Gravatar Jarred Sumner 2-12/+14
2023-03-14calculated class name after name propGravatar Dylan Conway 1-11/+8
2023-03-14Implement `toMatchSnapshot()` (#2294)Gravatar Dylan Conway 13-33/+529
* buggy snapshot * error output for failed snapshot * missing first * hints * open dir once, better cleanup * update flag * truncate on update * object and class snapshot formatting * array formatting * no function name, single item is empty array * string objects, maps, sets, promise * avoid using invalid memory * handle number objects * handle extending `Number` * boolean objects * snapshot tests and test updates * snapshot format for buffers * safer snapshot parsing * property matchers setup * strings and tests * generate classes with empty prototype * optional `propertyMatchers` parameter * new test folder structure * strings.eqlLong * globalObject.throwPretty() and expect.any tests * add updateSnapshot flag to help * move snapshot format out of `printErrorlikeObject` * empty object snapshot format * separate typed array, remove trailing comma * use `isCell`, object trailing commas * handle unicode * todo for primitive constructors * switch to `JSC.Node.Syscall.open` and `JSC.Maybe` * use js parser for snapshot files * deinit ast, log parse error * copy/paste most of `exports.ZigConsoleClient` * remove snapshot option * remove ordered properties option * remove snapshot format option from `exports.zig` * remove extra newlines * change mode * update test runner output * escape backticks faster * `bunx jest` in temp dir * remove buffered writer * add `toMatchSnapshot` to types * cleanup, switch to `pread` * cli `--update` flag * `--update-snapshots` * remove string object format
2023-03-12fix `require.resolve` with an empty options object #2370 (#2371)Gravatar dave caruso 1-3/+5
* fix #2370 and import-meta test * edit test to not allow transpiler optimization
2023-03-08More spec compliant `Blob.prototype.type` (#2340)Gravatar Jarred Sumner 5-11/+14
* Make `Blob.prototype. type` more spec compliant * Add a few more checks for isNumber() * Fix `make headers` * Safer JSValue.isString() * More tests for blob.slice * Make `Blob.prototype.type` more spec compliant * Add isASCII check * Fix types * Fix failing type test * Update blob.zig * Update blob.zig * Fix .eql check on empty values --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-07improve `Buffer` compatibility with Node.js (#2341)Gravatar Alex Lam S.L 4-293/+292
* improve `Buffer` compatibility with Node.js * use `memmove()` allow `encoding` to be `undefined`
2023-03-06throw invalid parameter errors in `crypto.scryptSync` (#2331)Gravatar Dylan Conway 1-0/+13
* throw invalid parameter errors * remove comptime, add empty buffer function * remove error_name comptime
2023-03-03fix(node:http): match Node headers casing (lowercase only) (#2288)Gravatar Derrick Farris 1-1/+1
* fix(node:http): match Node headers casing (lowercase only) * fix(JSFetchHeaders): `WTFMove` the ascii string
2023-03-03Update bindings.zigGravatar Jarred Sumner 1-7/+14
2023-03-03`BigInt64Array` and `BigUint64Array` are typed arrays tooGravatar Jarred Sumner 1-1/+13
Fixes #2296
2023-03-02put AbortSignal in WebCore namespace (#2267)Gravatar Ciro Spaciari 5-58/+58
2023-03-01fix(bindings): mark `JSCInitialize` (#2265)Gravatar Derrick Farris 1-0/+1
2023-03-01Update bindings.zigGravatar Jarred Sumner 1-1/+3
2023-02-28Make Bun.gc(true) more aggressiveGravatar Jarred Sumner 1-0/+3
2023-02-28Expose JSC::Options via `BUN_JSC_` prefixGravatar Jarred Sumner 2-1/+43
Example usage: BUN_JSC_logGC=1 bun file.js
2023-02-27fix(bun:sqlite): fix `sqliteDb.run(' ')` throwing `not an error` (#2226)Gravatar Derrick Farris 1-8/+8
2023-02-27Feat/os.network interfaces (#2142)Gravatar Justin Whear 1-2/+2
2023-02-26Add callback to benchGravatar Jarred Sumner 1-0/+8
2023-02-25Faster `eqlCaseInsensitiveASCII`Gravatar Jarred Sumner 1-3/+3
2023-02-25slight performance improvement to EventEmitterGravatar Jarred Sumner 4-41/+57
2023-02-24Support macOS 10.15Gravatar Jarred Sumner 1-4/+75
Fixes #1266 Fixes #1323 Fixes #2154
2023-02-24prefer `bun.copy()` over `std.mem.copy()` (#2152)Gravatar Alex Lam S.L 2-2/+2
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 7-22/+22
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-23Update ZigGlobalObject.cppGravatar Jarred Sumner 1-1/+1
2023-02-22Fix flaky request.signal implementationGravatar Jarred Sumner 1-24/+26
2023-02-22feat(Request.signal) Initial support for signal in Request + fetch and ↵Gravatar Ciro Spaciari 10-5/+120
Request + Bun.serve (#2097) * 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 * Request signal * remove package-lock.json * Remove JSC.Strong from Request signal * fix globals for fetch abort signal * more tests, clone signal crashs * fix AbortSignal.toJS * fix toJS bidings for AbortSignal * add streaming tests * fix abortion before connecting * fix tests and segfault * add fetch testing abort after finish * fix signal handler cleanup * support signal event Bun.serve * pull tests (failing) * remove unsupported test * formating * fix server Request.signal, fix cleanNativeBindings * add direct tests * more pull tests * fix stream tests * fix fetch, pending onAborted fix in HTTPServerWritable --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-22newlines for array diffGravatar Dylan Conway 1-3/+3
2023-02-22[breaking] Return Node.js `Timeout` objects in `setTimeout`, `setInterval`, ↵Gravatar Jarred Sumner 11-56/+408
and `setImmediate` Fixes #2129 #880
2023-02-22format options with quote strings (#2134)Gravatar Dylan Conway 1-20/+26
2023-02-22Fixes #2121 in runtime, but not in testsGravatar Jarred Sumner 1-39/+47
2023-02-22wiptest -> test (#2131)Gravatar Dylan Conway 1-4/+2
* +/- for object diff, quote more strings * wiptest -> test * quote strings fix
2023-02-21`isRegExp()` without cppGravatar Dylan Conway 1-1/+7
2023-02-21Update test runner output with colors and diffs (#2122)Gravatar Dylan Conway 5-41/+113
* add zig-diff * move diff functions * toHaveProperty diff for objects * use formatter * format labels * move work to format, diff when it makes sense * remove comptime, dim equal slices * order before diff * line diffs * add diffz * switch to diffz * add `diffLines()` function * small `prettyFmt()` bug fix * test runner color output * update `toBe()` error output * fix test * diff method, fix crash * fix link test * remove `isRegex`