aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-08-09Fix constructing buffer from a UTF16 string with the Latin1 encoding. (#4086)Gravatar Ai Hoshino 1-7/+3
Close: #3914
2023-08-09Update SIMDUTF (#4078)Gravatar Jarred Sumner 2-25766/+24092
2023-08-08feat(bun:test) add support for test.each() and describe.each() (#4047)Gravatar Jacques 1-16/+235
* rename callback to func * update testscope to handle function arguments * works * big cleanup * works in debug, not release * fix memory issue & update tests * catch & str test * write types for each() & switch tests to ts * rm & typo * move some code around & support describe * review changes
2023-08-08worker tests (#4058)Gravatar dave caruso 2-3/+5
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-08feat(bun/test): Implement "toSatisfy" & "toIncludeRepeated" (fwup) (#3651)Gravatar Tiramify (A.K. Daniel) 4-0/+276
* Fix merge issues * oop * make codegen * Fix build issues --------- Co-authored-by: dave caruso <me@paperdave.net>
2023-08-08Set exports to {} in user-constructed CommonJSModuleRecords (#4076)Gravatar dave caruso 1-0/+4
2023-08-08Fix require("console") #3820 (#4073)Gravatar dave caruso 2-2/+5
* Fix #3820 * Add Module (#4074)
2023-08-08Update Worker.cppGravatar Dylan Conway 1-1/+0
2023-08-081. Check if the argument is an empty string in `path.format`. (#4064)Gravatar Ai Hoshino 1-4/+17
2. Avoid duplicating '/' at the beginning of the path. Close: #4005
2023-08-08import bun (#4055)Gravatar Jarred Sumner 4-0/+36
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-08Enable `Headers.prototype.getSetCookie`Gravatar Jarred Sumner 1-23/+10
Fixes #4057
2023-08-08Remove printfGravatar Jarred Sumner 1-1/+0
2023-08-07Add `env` option for `node:worker_threads` (#4052)Gravatar dave caruso 11-60/+113
* almost works * env stuff * test fixes * wtfmove * ok * ok * ref by default * it now does the ref stuff by default * cool
2023-08-07Fix `Bun.hash` functions (#4054)Gravatar jhmaster 1-6/+6
* fix `Bun.hash` functions to behave as expected * update Bun.hash tests * properly test the returned hash * include murmur32v2 * update Bun.hash docs * run fmt
2023-08-07fix `worker.ref()`Gravatar Dylan Conway 1-1/+1
2023-08-07implement fetching data urls (#4000)Gravatar Dylan Conway 3-1/+70
* fetch data urls * `byteSlice` * deinit slice * allocate `mime_type` string if needed * `content_type_allocated` and uncomment tests * `str_` * createAtom and slice decode result
2023-08-07fix iterating headers with `set-cookie` (#4048)Gravatar Dylan Conway 3-40/+30
* fix iterating headers with `set-cookie` * a test * move work to `HTTPHeaderMap::set` * append set-cookie after sort * remove compare function
2023-08-07Fix `path.normalize` edge case. (#4042)Gravatar Ai Hoshino 1-1/+1
Close: #4041
2023-08-06Fixes #4001 (#4034)Gravatar Jarred Sumner 2-9/+26
* Avoid a utf8 conversion in isDetached * Fixes #4001 * hit the long url codepath --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06Fixes #3129 (#4018)Gravatar Jarred Sumner 2-98/+51
* Fixes #3129 * add CloseEvent --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06Code coverage for `bun test` (#3975)Gravatar Jarred Sumner 12-18/+199
* WIP code coverage initial commit * almost works * one approach * Code Coverage * Update WebKit * it works but is not yet accurate * skip double ascii check * wrapper * it works but i'm not sure what to do about blocks * hide blocks for now * Update ZigSourceProvider.cpp * Create coverage.md * Update nav.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06feat: impl `dns.getServers` (#3982)Gravatar Ai Hoshino 2-0/+94
* feat: impl `dns.getServers` Close: #3981 * check return value of `ares_inet_ntop`
2023-08-06Implement --test-name-pattern (#3998)Gravatar dave caruso 4-2/+125
* Fix end not being emitted all the time * stuff * Implement -t * Undo js_printer changes * Undo http changes * Update InternalModuleRegistryConstants.h * Delete unrelated test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-05Remove Bun.plugin transpiler hook, encourage usage of `--preload` instead ↵Gravatar dave caruso 1-147/+1
(#3987) * Remove Bun.plugin transpiler hook * one missing case
2023-08-04Fixes #3991Gravatar Jarred Sumner 1-4/+4
Fixes #3991
2023-08-04Buffer.copy should ignore out-of-range sourceEnd (#3971)Gravatar Yifei Wang 1-1/+2
2023-08-04feat(hot-clear-screen): clear terminal on hot reload (#3976)Gravatar simylein 1-0/+7
* feat(hot-clear-screen): clear terminal on hot reload * fix(hot-clear-screen): is now I n the correct place * fix(hot-clear-screen): enable buffering after terminal clear
2023-08-03Fix thread safety issue in async fs functions file paths (#3964)Gravatar Jarred Sumner 3-3/+29
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03Implement Module.wrap()Gravatar Jarred Sumner 1-23/+45
2023-08-03Bunch of fixes (#3516)Gravatar Ashcon Partovi 10-117/+166
* Fix #3497 * Fix #3497 * Run prettier * Fix package.json * remove this too * yeah * Fix missing tests * Use native for utf-8-validate * Add module ID names to builtins * Defer evaluation of ESM & CJS modules until link time * Use builtin name for exports in plugins * Add module IDs to builtins * Update JSC build with new flag * WebKit upgrade fixes * Update WebKit * prettier * Upgrade WebKit * bump * Update once again * Add visitAdditionalChildren, remove .fill() usage * Update process.test.js * Update fs.test.ts --------- Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03Fix the string encoding in `path.extname`. (#3949)Gravatar Ai Hoshino 1-1/+1
Close: #3948
2023-08-02SvelteKit compatibility hackGravatar Jarred Sumner 1-1/+4
2023-08-02Dave/removedeprecation (#3938)Gravatar dave caruso 1-178/+48
* hide deprecated stuff * this edit * hi
2023-08-02Implement `node:worker_threads` (#3923)Gravatar Jarred Sumner 15-54/+175
* Start to implement `worker_threads` * more * more!! * more * Update bundle_v2.zig * delete outdated tests * `receiveMessageOnPort` * props test and export default * fix merge * not implemented tests * individual imports * `receiveMessageOnPort` tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-08-02Implement `node:diagnostics_channel` (#3934)Gravatar Ashcon Partovi 1-63/+64
* Add types for `node:async_hooks` * Implement \`node:diagnostics_channel\`
2023-08-02Rewrite built-in modules to use CommonJS over ESM (#3814)Gravatar dave caruso 39-2690/+4469
* stfdsafsd sadffdsa stuff finish commonjs stuff asdf not done but work not done but work not done yet but this is how far i am remove files lol update built files uncomment everything in events lol export default stuff * afdsafsd * its not perfect but almost done * okay * cool * remove temp file * finish rebase * revert settings.json * a * ch-ch-ch-ch-changes * okay * remove this check in release for now * sxdcfghnjm, * lkjhgf * fmt * filename can be null * Update NodeModuleModule.h * weee * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-02Fixes #3931 (#3933)Gravatar Jarred Sumner 1-37/+9
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-02Fix path_watcher (#3920)Gravatar Ciro Spaciari 1-106/+174
* fix callback and onError * fix main watcher error return * fixup * rename to be more clear
2023-08-02clean declare structs (#3929)Gravatar Ciro Spaciari 1-2/+1
2023-08-01add `BroadcastChannel` (#3922)Gravatar Dylan Conway 17-43/+1566
* copy and format * update `SerializedScriptValue.cpp` * use `expect().fail()` in message channel tests * rename `BroadcastChannelIdentifier.h` * copy registries * progress and tests * cleanup * worker and broadcast channel test * `BroadcastChannel` ref and unref * `MessagePort` ref, unref, and hasRef * remove `SecurityContext.cpp/h` * add types
2023-08-01Update JSWorker.cppGravatar Jarred Sumner 1-1/+1
2023-08-01Implement Worker.prototype.threadIdGravatar Jarred Sumner 2-2/+18
2023-07-30Fix memory leak in response.clone(), further reduce memory usage of Request ↵Gravatar Jarred Sumner 8-120/+146
& Response (#3902) * Atomize respsone.url & response.statusText * Fix warning * Atomize Request & Response URLs when possible * Fix memory leak in response.clone() bun/bench/snippets on  jarred/atomize ❯ mem bun --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.2 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 77.3 ns/iter (40.35 ns … 222.64 ns) 91.53 ns 128.11 ns 172.78 ns resp.clone().url 162.43 ns/iter (116 ns … 337.77 ns) 177.4 ns 232.38 ns 262.65 ns Peak memory usage: 60 MB bun/bench/snippets on  jarred/atomize ❯ mem bun-0.7.1 --smol request-response-clone.mjs cpu: Apple M1 Max runtime: bun 0.7.1 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p995 -------------------------------------------------------- ----------------------------- req.clone().url 115.85 ns/iter (80.35 ns … 247.39 ns) 128.19 ns 181.93 ns 207.23 ns resp.clone().url 252.32 ns/iter (202.6 ns … 351.07 ns) 266.56 ns 325.88 ns 334.73 ns Peak memory usage: 1179 MB * Update tests * Update js_ast.zig * Update test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30skip flay testGravatar Jarred Sumner 1-4/+3
2023-07-30Support `bun .` to run the entry point (#3891)Gravatar Jarred Sumner 2-114/+12
* Support `bun .` * Fix tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30Fix issue with file loader (#3889)Gravatar Jarred Sumner 1-3/+22
* Fix issue with file loader * Update jest-extended.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30remove unnecessary moveGravatar Jarred Sumner 1-1/+1
2023-07-30Fix memory leak (#3887)Gravatar Jarred Sumner 9-78/+182
* Fix memory leak * Remove an extra copy * Further fixes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30Fix coredump when reading an empty file(`node:stream:createReadStream`) (#3882)Gravatar Ai Hoshino 1-0/+4
* Fix coredump when reading an empty file. Close: #3607 * It seems that the fd is closed when `auto_close` is true.
2023-07-30Improv. (#3885)Gravatar Tiramify (A.K. Daniel) 1-13/+16