aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-03-18Fix crash when rendering error page and the server or network is slowGravatar Jarred Sumner 1-0/+1
2023-03-18Fix several bugs (#2418)Gravatar Dylan Conway 4-4/+28
* utf16 codepoint with replacement character * Fix test failure with `TextEncoder("ascii')` * Add missing type * Fix Response.prototype.bodyUsed and Request.prototype.bodyUsed * Fix bug with scrypt error not clearing * Update server.zig * oopsie
2023-03-17Fix various fetch/response/request tests (#2416)Gravatar Dylan Conway 14-116/+234
* 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 6-8/+112
2023-03-15Fix socket tests with connection errors (#2403)Gravatar Dylan Conway 1-0/+2
* release pending activity with connection error handler * unref poll_ref
2023-03-15feat(expect): update toBeInstanceOf (#2396)Gravatar zhiyuan 6-15/+42
* feat: update instanceof binding * fix: according to PR comments
2023-03-15Fixes #2399Gravatar Jarred Sumner 2-12/+14
2023-03-15allows Bun.serve to listen on IPV6 (#2400)Gravatar Ciro Spaciari 1-26/+63
2023-03-14calculated class name after name propGravatar Dylan Conway 1-11/+8
2023-03-14Implement `toMatchSnapshot()` (#2294)Gravatar Dylan Conway 22-59/+3168
* 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-14Add missing exportGravatar Jarred Sumner 1-6/+8
2023-03-14Fix missing `constants` export in zlibGravatar Jarred Sumner 1-2/+3
2023-03-14feat: add toBeInstanceOf matcher in expect (#2389)Gravatar zhiyuan 1-1/+64
2023-03-14Fix `node:https` being readonlyGravatar Jarred Sumner 2-8/+4
2023-03-14Fix text formatting in .remoteAddress in `ServerWebSocket` and `Socket`Gravatar Jarred Sumner 3-34/+26
Fixes #2387
2023-03-13feat(net.createServer) and adds socket.connect IPC support (#2337)Gravatar Ciro Spaciari 2-9/+316
* added net.Server * fix fmt * fix cast and move test * fix node-net.tests.ts but breaks server data receive * fix end and close only emitting when data or pipe was added * fix socket starting paused * add echo test * fix fmt * fix fmt * on close if the socket is paused, keep paused until the user resumes it to match node behavior * resume on connect * fix getConnections, error on close, make _Handler private and create symbols for SocketServerHandlers * add path support (IPC) * fix unix domains support, add connect unix tests * fix unix socket tests * emit listening and listening error on next tick * fix connection flask test * try fix connect error on macos test * merge connection and drop tests * added exclusive option * fix socket.zig fmt * fix validation for options and add test for it * pass prettier fmt
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-08fix(node:child_process): fix missing primordial `StringPrototypeSlice` (#2352)Gravatar Derrick Farris 1-0/+1
2023-03-08More spec compliant `Blob.prototype.type` (#2340)Gravatar Jarred Sumner 11-58/+145
* 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-07"binary" is an alias of "latin1"Gravatar Jarred Sumner 1-2/+5
Fixes https://github.com/oven-sh/bun/issues/2110
2023-03-07improve `Buffer` compatibility with Node.js (#2341)Gravatar Alex Lam S.L 12-944/+1055
* 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 3-105/+125
* throw invalid parameter errors * remove comptime, add empty buffer function * remove error_name comptime
2023-03-06feat(tty): add some `tty.WriteStream` methods to `process.{stdout, stderr}` ↵Gravatar Derrick Farris 2-1/+47
(#2320) * feat(stdio): add some `tty.WriteStream` methods * chore(builtins): add process builtin gen'd code
2023-03-05fix missing `Blob` error messages on Linux (#2315)Gravatar Alex Lam S.L 1-5/+5
2023-03-06support `expect().toThrow(/pattern/)` (#2314)Gravatar Alex Lam S.L 1-3/+74
- fix time-zone-dependent test failure
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-03Improve types for `node:http` (#2284)Gravatar Colin McDonnell 1-0/+4
* Document node:http * Fix test * Fix default * Fix default
2023-03-03Fix http server req url (#2285)Gravatar zhiyuan 1-1/+1
* fix: http url add search query * fix: add tests
2023-03-02Add a zig fmt action (#2277)Gravatar Jarred Sumner 4-37/+20
* Add a zig fmt action * add failing file * Setup prettier better * Update prettier-fmt.yml * Fail on error * Update prettier-fmt.yml * boop * boop2 * tar.gz * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * Update zig-fmt.yml * boop * Update prettier-fmt.yml * tag * newlines * multiline * fixup * Update zig-fmt.yml * update it * fixup * both * w * Update prettier-fmt.yml * prettier all the things * Update package.json * zig fmt * ❌ ✅ * bump * . * quotes * fix prettier ignore * once more * Update prettier-fmt.yml * Update fallback.ts * consistentcy --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-02fix(os.tmpdir()) strip trailing slash on *unix machines (#2276)Gravatar Ciro Spaciari 1-98/+76
* fix(os.tmpdir()) strip trailing slash on *unix machines * make use of strings.withoutTrailingSlash(dir);
2023-03-02put AbortSignal in WebCore namespace (#2267)Gravatar Ciro Spaciari 9-69/+70
2023-03-02only free sink after promises solves (#2268)Gravatar Ciro Spaciari 2-10/+10
2023-03-02Fix `Bun.sleepSync` to actually use milliseconds (#2242)Gravatar Justin Whear 1-4/+24
* Fix Bun.sleep/sleepSync to actually use milliseconds `Bun.sleepSync` was accidentally treating its argument as seconds rather than milliseconds as the docs stated. This is a breaking change in that the function now behaves as documented. Fixed relevant tests. * sleepSync: add more argument checking, tests
2023-03-01fix(bindings): mark `JSCInitialize` (#2265)Gravatar Derrick Farris 1-0/+1
2023-03-01fix bun server segfault with abortsignal (#2261)Gravatar Ciro Spaciari 2-24/+79
* removed redundant tests, fixed server segfault * fix onRejectStream, safer unassign signal * fix abort Bun.serve signal.addEventListener on async * move ctx.signal null check up * keep original behavior of streams onAborted
2023-03-01fix(node:http): match Node `http.request()` GET/HEAD w/ body (#2262)Gravatar Derrick Farris 1-2/+6
2023-03-01Add a test for https request in node:httpGravatar Jarred Sumner 1-17/+12
2023-03-01fix(node:http/https): fix passing `URL` objs to `http.request`(#2253) (#2258)Gravatar Derrick Farris 1-15/+16
* fix(node:http/https): fix passing `URL` objs to `http.request`(#2253) * fix(node:http): hoist debug env var * fix(node:http): make body `undefined` when falsy
2023-03-01avoids segfault after aborted onReject in Bun.serve streams (#2256)Gravatar Ciro Spaciari 1-7/+8
* avoids segfault after aborted on reject * silence err on handleRejectStream after aborted
2023-03-01Revert spawnSync changeGravatar Jarred Sumner 1-1/+2
cc @FireTheFox
2023-03-01Update bindings.zigGravatar Jarred Sumner 1-1/+3
2023-03-01fix deinit behavior when connection is aborted using ResponseStream and ↵Gravatar Ciro Spaciari 2-34/+60
abort event behavior (#2252) * fix deinit behavior when connection is aborted using ResponseStream * fix abort handling on stream, and get better tests * avoid segfault by trying to deinit 2x when aborted * make tests more reliable * more reliable onResolveStream after aborted * add test case for not firing the abort signal
2023-03-01fix Bun.file.arrayBuffer() segmentation fault on empty file #2248 (#2249)Gravatar Ciro Spaciari 1-7/+15
* fix Bun.file.arrayBuffer() segmentation fault on empty file #2248 * cleanner this.iotask check
2023-02-28Make Bun.gc(true) more aggressiveGravatar Jarred Sumner 1-0/+3
2023-02-28Expose JSC::Options via `BUN_JSC_` prefixGravatar Jarred Sumner 3-4/+43
Example usage: BUN_JSC_logGC=1 bun file.js
2023-02-28Don't tick the event loop in spawnSyncGravatar Jarred Sumner 1-3/+1
2023-02-28Make response.body `null` only when user explicitly passes null/undefinedGravatar Jarred Sumner 3-2/+16
2023-02-28Add explicit Null tag to BodyGravatar Jarred Sumner 1-11/+11
This reverts commit e538bb31ad7a2c4b4ce2b1f7d6b18a3140939950.