aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-10fix "readable" event being emitted incorrectly (#3475)Gravatar dave caruso 1-1/+0
* fix "readable" event being emitted incorrectly * fix impl and add test * changes * asdfghj * esm
2023-07-09Fixes #3530 (#3587)Gravatar Jarred Sumner 1-0/+23
* Fixes #3530 * Handle OOM * Add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-09Implement process.memoryUsage() and process.cpuUsage() (#3586)Gravatar Jarred Sumner 5-58/+447
* Implement process.memoryUsage() and process.cpuUsage() * Avoid mi_process_info * Update bench * Update Process.cpp * fixup * More tests + linux fixup * Skip it for now since it seems less accurate --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-09Implement nearly all of `process` object methods and properties (#3581)Gravatar Jarred Sumner 5-434/+748
* Add special case * Make process object load faster * Fix openStdin --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Implement `process.on("beforeExit", cb)` and `process.on("exit", cb)` (#3576)Gravatar Jarred Sumner 4-73/+219
* Support `process.on('beforeExit')` and `process.on('exit')` * [bun:sqlite] Always call sqlite3_close on exit * Update process.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07Use BunString in JSBundlerPlugin (#3557)Gravatar Jarred Sumner 2-23/+44
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07Fix potential coercion issue (#3558)Gravatar Jarred Sumner 1-1/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07fix decoding invalid UTF-8 input (#3563)Gravatar Ai Hoshino 1-2/+2
* fix decoding invalid UTF-8 input Close: https://github.com/oven-sh/bun/issues/3562 * add unittest
2023-07-07[node:fs] `read`, `write` - support large numbers and BigInt (#3556)Gravatar Jarred Sumner 1-2/+3
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06refactor (#3543)Gravatar Ciro Spaciari 4-86/+18
2023-07-05Fixes #3515 (#3523)Gravatar Jarred Sumner 1-32/+1
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-04Add alias for readBigUInt64BE ... (#3514)Gravatar Ai Hoshino 1-4/+13
* Add alias for `readBigUInt64BE` ... Close: https://github.com/oven-sh/bun/issues/3338 * add some tests for `readBigUint64BE` alias * format code
2023-07-04Fix crashGravatar Jarred Sumner 1-5/+8
2023-07-04Fix napiGravatar Jarred SUmner 1-5/+79
2023-07-03Allow zero length WebSocket client & server messages (#3488)Gravatar Jarred Sumner 5-25/+75
* Allow zero length WebSocket client & server messages * Add test * Clean this up a little * Clean up these tests a little * Hopefully fix the test failure in release build * Don't copy into the receive buffer * Less flaky --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03Fixes #3317Gravatar Jarred Sumner 1-7/+10
2023-07-03Fixes #3508Gravatar Jarred Sumner 1-1/+21
2023-07-03[tls] add socket parameter, setServername and ALPNprotocols support (#3457)Gravatar Ciro Spaciari 6-4/+248
* add socket parameter support * refactor #socket * add test and more fixs * some fixes * bump uws * handlers fix * more fixes * fix node net and node tls tests * fix duplicate port * fix deinit on CallbackJobs * cleanup * add setImmediate repro * add test to setImmediate * this is necessary? * fix prependOnce on native listener * try to findout the error on nodemailer CI * show error message * Update bun.lockb * prettier * Use exact versions of packages * add alpnProtocol support * update * emit error when connect fails on net.Socket * format * fix _write and cleanup * fixup * fix connect, add alpn test * fix socket.io * add socket parameter to TLSSocket * add TLSSocket socket first parameter * fixup and _start * remove flask tests * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02Stub out `useFakeTimers` and `useRealTimers`Gravatar Jarred Sumner 1-0/+12
2023-07-02Support mocking `new Date()` & `Date.now()` in bun:test (#3501)Gravatar Jarred Sumner 1-0/+24
* Support changing the time * Bump WebKit * Update bun.lockb --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02Fixes #3499Gravatar Jarred Sumner 1-9/+7
2023-07-02Add commentGravatar Jarred Sumner 1-0/+4
2023-07-02Use fast path for Base64 in `btoa` (#3504)Gravatar Jarred Sumner 1-21/+53
* Use fast path for Base64 in `atob` * Fix utf16, crash on linux --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02fix zero length env var (#3496)Gravatar dave caruso 1-2/+2
2023-07-02Fixes #3495Gravatar Jarred Sumner 1-4/+0
2023-07-01Use `BunString` in `SystemError` (#3485)Gravatar Jarred Sumner 7-57/+112
* Use `BunString` in SystemError * Use Bun::toStringRef when we will de-ref strings * Move `napi_create_error` to C++ to support `code` being a Symbol potentially * Update blob.zig * Make this test less flaky --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01Slight fixupGravatar Jarred Sumner 1-2/+8
2023-07-01small cleanupGravatar Jarred Sumner 1-12/+21
2023-07-01[WIP]Fix calling `Buffer.toString` with `(offset, length, encoding)` (#3467)Gravatar Ai Hoshino 1-27/+40
* Allow `toString` to be called with `(offset, length, encoding)`. Close: #3085 * handle undefined value * add tests for buffer.xxxSlice * fix parameters * fix offset and length
2023-07-01skip private class fields (#3484)Gravatar Dylan Conway 1-6/+6
2023-06-29Add missing "prependListener" functionbun-v0.6.12Gravatar Jarred Sumner 1-1/+1
2023-06-29Fixes `node:http` and `node:stream` so `ytdl-core` works. (#3452)Gravatar dave caruso 1-1/+4
* fix crash in readablestate * make node:https request+get actually use https * use a native readablestream in IncomingMessage * tweaks * fix abort crash * emit close by default * remove abort. this isnt a real function * add validate functions, fixup some other requested changes. not done yet * Update WebCoreJSBuiltins.cpp * Update JSReadableState.cpp * Add some missing exports --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28Prevent integer overflowGravatar Jarred Sumner 1-2/+2
2023-06-28Ref the stringsGravatar Jarred Sumner 1-2/+9
2023-06-28Add GC test for errorsGravatar Jarred Sumner 1-2/+6
2023-06-28Use `bun.String` for `ZigException` (#3451)Gravatar Jarred Sumner 4-103/+116
* Use `bun.String` for `ZigException` * woopsie --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28Introduce `await Bun.file(path).exists()` (#3446)Gravatar Jarred Sumner 2-0/+34
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28Error.prototype.stack gets sourcemapped stacktraces and introduce ↵Gravatar Jarred Sumner 2-28/+188
Error.appendStackTrace (#3441) * Fix potential crash when reading sourcemapped stack traces * Format & sourcemap Error.prototype.stack * prevent double sourcemapping * Introduce Error.appendStackTrace * Fix source url * hide private stack traces in non-debug builds * fixes #3443 * Bump WebKit * Fix test failure in vm.test * Support new() & add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-27Fix some checksGravatar Jarred Sumner 1-3/+3
2023-06-27getIfPropertyExists is safer than getDirect (#3391)Gravatar Jarred Sumner 1-16/+17
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26fix #3412 (#3422)Gravatar dave caruso 1-4/+8
2023-06-26Tweak the ramSize setting because /= 1024 is causing CI to fail on arm64 ↵Gravatar Jarred Sumner 1-1/+7
when there's only 8 GB of ram
2023-06-26change the text from "error" to "warn"Gravatar Jarred Sumner 1-5/+7
2023-06-26`.randomInt()` support (#3357)Gravatar Silas Rech 2-1/+2
* Add initial .randomInt() fallback * Add basic .randomInt() test * Attempt creating a native implementation * Switch to JSC.wrapWithHasContainer * Switch to .jsNumberFromUint64(), it seems like using just .jsNumber() causes the number to overflow in some cases * Regenerate out folder after rebasing
2023-06-26Runtime support for `__esModule` annotations (#3393)Gravatar Jarred Sumner 4-12/+110
* Runtime support for `__esModule` annotations * Ignore `__esModule` annotation when `"type": "module"` is set --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26implement `_nodeModulePaths` and `require.main.paths` (#3411)Gravatar Dylan Conway 2-0/+32
* tests in progress * add `require.main.paths`, add every dir up to root * remove imports
2023-06-25Fix test failures in import.meta (#3403)Gravatar Jarred Sumner 4-76/+144
* Fix test failures in import.meta * regenerate * Use bound functions for `import.meta.require` and `import.meta.require.resolve` and `Module.createRequire` --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25[fs.watch] fix reference/deinit (#3396)Gravatar Ciro Spaciari 6-3/+41
* fix js reference * fix close oops * refactor + hasPendingActivity * fmt * fix race conditions * fixup * add test calling close on error event * fix close inside close + test * cleanup
2023-06-25Add `process.mainModule`Gravatar Jarred Sumner 1-0/+12
2023-06-25Revert "make these strings lazy"Gravatar Jarred Sumner 1-37/+26
This reverts commit 777f98bd1068239033718c44bdcfca87e58a91d5.