aboutsummaryrefslogtreecommitdiff
path: root/test/js/node (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-12Make Error.captureStackTrace 4x fasterjarred/faster-error-capturestacktraceGravatar Jarred Sumner 1-2/+2
2023-07-11Update process.test.jsGravatar Jarred Sumner 1-2/+2
2023-07-11Implement `process.kill` and `process._kill`Gravatar Jarred Sumner 1-0/+27
2023-07-11Testsjarred/throw-ifGravatar Jarred Sumner 1-0/+12
2023-07-11Merge branch 'jarred/fix-http-compression'Gravatar Jarred Sumner 1-0/+33
2023-07-11process signal events (#3569)Gravatar Dylan Conway 3-2/+102
* signal events * simple tests * ignore SIGSTOP * better tests * use `EventEmitter` * use `Bun__getDefaultGlobal` * progress * don't use 'Bun__getDefaultGlobal` * fix tests * remove signals from map * update tests * don't overwrite event emitter methods * avoid two lookups * use `std::once` * releaseEarly() * Remove signal handler after use * Update call-raise.js * Create process-signal-handler.fixture.js * Don't register duplicates * Add missing lock * another test * update test * revert some changes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-11Merge branch 'main' into fix-httpGravatar Ai Hoshino 2-1/+31
2023-07-11small fix, check if the method has been reassigned.Gravatar Hanaasagi 1-1/+1
2023-07-10fix "readable" event being emitted incorrectly (#3475)Gravatar dave caruso 1-0/+23
* fix "readable" event being emitted incorrectly * fix impl and add test * changes * asdfghj * esm
2023-07-10feat(crypto) add getCurves (#3598)Gravatar Ciro Spaciari 1-1/+8
* add getCurves * add nodefallbacks * update docs * oops
2023-07-10Merge branch 'main' into fix-httpGravatar Ai Hoshino 2-2/+184
2023-07-10add testsGravatar Hanaasagi 1-0/+33
2023-07-09Fixes #3530 (#3587)Gravatar Jarred Sumner 1-0/+44
* 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 1-2/+140
* 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-08Implement `process.on("beforeExit", cb)` and `process.on("exit", cb)` (#3576)Gravatar Jarred Sumner 6-3/+117
* 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-07fix decoding invalid UTF-8 input (#3563)Gravatar Ai Hoshino 1-0/+9
* fix decoding invalid UTF-8 input Close: https://github.com/oven-sh/bun/issues/3562 * add unittest
2023-07-07Update types, partially fix `typecheck` (#3551)Gravatar Colin McDonnell 1-43/+43
* Update types * Remove caret
2023-07-07[node:fs] `read`, `write` - support large numbers and BigInt (#3556)Gravatar Jarred Sumner 1-0/+52
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06Add util.toUSVStringGravatar Jarred Sumner 1-0/+17
2023-07-05Fixes #3512 (#3526)Gravatar Jarred Sumner 1-6/+7
* Fixes #3512 * Fix `clearTimeout` and `clearInterval` not cancelling jobs same-tick --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-04Add alias for readBigUInt64BE ... (#3514)Gravatar Ai Hoshino 1-0/+45
* Add alias for `readBigUInt64BE` ... Close: https://github.com/oven-sh/bun/issues/3338 * add some tests for `readBigUint64BE` alias * format code
2023-07-03[fix] patch fs.watch sym link (#3481)Gravatar Ciro Spaciari 1-0/+55
* oopsie * add tests --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-03[tls] add socket parameter, setServername and ALPNprotocols support (#3457)Gravatar Ciro Spaciari 3-110/+32
* 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-02[node:buffer] Implement `isUtf8` and `isAscii` (#3498)Gravatar Jarred Sumner 1-1/+23
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01[WIP]Fix calling `Buffer.toString` with `(offset, length, encoding)` (#3467)Gravatar Ai Hoshino 1-0/+79
* 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-06-29Fixes `node:http` and `node:stream` so `ytdl-core` works. (#3452)Gravatar dave caruso 1-1/+22
* 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-29Make `node:os` `tmpdir` more consistent with Node.jsGravatar Jarred Sumner 1-0/+5
2023-06-29cant believe i missed this (#3453)Gravatar dave caruso 1-0/+13
2023-06-28export resolve6 from dns/promises (#3450)Gravatar dave caruso 2-0/+33
2023-06-28Error.prototype.stack gets sourcemapped stacktraces and introduce ↵Gravatar Jarred Sumner 1-0/+12
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 `node:util.callbackify` (#3428)Gravatar Ai Hoshino 1-0/+323
* remove the incorrect parameters Close: https://github.com/oven-sh/bun/issues/3424 * fix error code * add callbackify tests * fix function type * ensure `done` is called when error occurred
2023-06-26Fix default export of `"module"` modulebun-v0.6.10Gravatar Jarred Sumner 1-0/+5
2023-06-26`.randomInt()` support (#3357)Gravatar Silas Rech 1-0/+21
* 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-26Implement writev & readv (#3419)Gravatar Jarred Sumner 1-0/+65
* [node:fs] Implement `writev` and `readv` * writev & readv tests * cast to const type * woops * cast --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26implement `_nodeModulePaths` and `require.main.paths` (#3411)Gravatar Dylan Conway 1-0/+19
* tests in progress * add `require.main.paths`, add every dir up to root * remove imports
2023-06-25[fs.watch] fix reference/deinit (#3396)Gravatar Ciro Spaciari 1-1/+44
* 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-25Fix the parameters of WriteStream constructor. (#3402)Gravatar Ai Hoshino 1-0/+38
* Fix the parameters of the `WriteStream` constructor. Close: https://github.com/oven-sh/bun/issues/3395 * test append mode in `createWriteStream` * fix lint * wait first stream finished
2023-06-24Rewrite Bun's runtime CommonJS loader (#3379)Gravatar Jarred Sumner 11-21/+72
* wip changes for CommonJS * this rewrite is almost complete * even more code * wip * Remove usages of `import.meta.require` from builtins * Remove usages of require * Regenerate * :scissors: builtin rewrite commonjs in printer * Use lazy custom getters for import.meta * fixups * Remove depd * ugh * still crashing * fixup undici * comment out import.meta.require.resolve temporarily not a real solution but it stops the crashes * Redo import.meta.primordials * Builtins now have a `builtin://` protocol in source origin * Seems to work? * Finsih getting rid of primordials * switcharoo * No more function * just one more bug * Update launch.json * Implement `require.main` * :scissors: * Bump WebKit * Fixup import cycles * Fixup improt cycles * export more things * Implement `createCommonJSModule` builtin * More exports * regenerate * i broke some stuff * some of these tests work now * We lost the encoding * Sort of fix zlib * Sort of fix util * Update events.js * bump * bump * bump * Fix missing export in fs * fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet. * fix some other internal module bugs * oops * fix some extra require default stuff * uncomment this file but it crsahes on my machine * tidy code here * fixup tls exports * make simdutf happier * Add hasPrefix binding * Add test for `require.main` * Fix CommonJS evaluation order race condition * Make node:http load faster * Add missing exports to tls.js * Use the getter * Regenerate builtins * Fix assertion failure in Bun.write() * revamp dotEnv parser (#3347) - fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042 * fix tests for `expect()` (#3384) - extend test job time-out for `darwin-aarch64` * `expect().resolves` and `expect().rejects` (#3318) * Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * fixup min/memcopy (#3388) * Fix crash in builtins * Don't attempt to evaluate modules with no source code * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Fix crash * cleanup * Fix test cc @paperdave * Fixup Undici * Fix issue in node:http * Create util-deprecate.mjs * Fix several bugs * Use the identifier * Support error.code in `util.deprecate` * make the CJs loader slightly more resilient * Update WebCoreJSBuiltins.cpp * Fix macros --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-06-23[feat] fs.watch (#3249)Gravatar Ciro Spaciari 5-0/+466
* initial support * add types * fix comment * fix types * bigfix up * more fixes * fix some encoding support for watch * fix rename event * fixup * fix latin1 * add fs_events, still failing some tests * fixuup * remove unecesary check * readd tests ops * this is necessary? just testing CI/CD weird errors * just use dupe here * cleanup and fix deinit * fix zig upgrade
2023-06-23Make node-fallbacks build as esm not cjs / Fix `node-fetch` (#3377)Gravatar dave caruso 1-1/+13
* Make node-fallbacks build as esm not cjs. * fix stuff
2023-06-20woopsGravatar Jarred Sumner 1-1/+1
2023-06-20Clone SourceOrigin stringGravatar Jarred Sumner 1-0/+9
2023-06-20Cleanup fs.utimesSync (#3363)Gravatar Jarred Sumner 1-0/+72
* Fix UB in fs.utimesSync when passing a number with an integer greater than i32 * Fix make headers --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20prettierGravatar Jarred Sumner 1-15/+21
2023-06-19implement more of V8's stack trace API (#3359)Gravatar Keyhan Vakil 1-0/+152
- fix source map positions for getLineNumber / getColumnNumber - fix return value getting coerced to a string - implement CallFrame.p.toString - add tests for getFunction, getThis, isConstructor, isNative, toString, getLineNumber, getColumnNumber still not implemented: - isPromiseAll/getPromiseIndex - getEvalOrigin - getScriptHash - getPosition - getEnclosingColumnNumber/getEnclosingLineNumber - isAsync - accessing Error.stack should call prepareStackTrace still broken: - isEval: often returns false when it should return true - isToplevel: often returns true when it should return false Refs: https://v8.dev/docs/stack-trace-api Refs: v8/src/objects/call-site-info.cc Fixes: https://github.com/oven-sh/bun/issues/2883
2023-06-18Fix a bunch of bugs (#3352)Gravatar Jarred Sumner 1-1/+56
* Fix a bunch of bugs * undo that one * Fix crash in readdir() * woops * woops * Add comment * :scissors: * Make `readlink()` and `realpath` use much less memory * Update BunString.cpp * woopsie * Unnecessary * Don't commit these --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-14Make `Bun.argv` the same as `process.argv` (#3310)Gravatar Jarred Sumner 1-0/+10
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-13Add testGravatar Jarred Sumner 1-0/+6
2023-06-05[node:vm] Fix crash when `new ArrayBuffer()` is returnedGravatar Jarred Sumner 1-0/+21
2023-06-03Fix crash with path parse in win32 (#3187)bun-v0.6.7Gravatar Jarred Sumner 1-0/+66
* Update CommonJSModuleRecord.cpp * smaller * [node:path] Fix crash, mark TODO --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>