aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-09fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and ↵Gravatar Ciro Spaciari 2-0/+9
fetch errors (#6390) * fix abort signal and fetch error * fix fetch error and lock behavior
2023-10-09fix: support uint8 exit code range (#6303)Gravatar Liz 1-2/+2
The exit code support is between 0-255 and not only in the signed positive range (0-127). Node.js does not seam to throw on a bigger integer and just wraps around, but throwing a error is a good approach and makes the behaviour more defined. This allows the range to be 0-255 Fixes: https://github.com/oven-sh/bun/issues/6284
2023-10-07feat(KeyObject) (#5940)Gravatar Ciro Spaciari 21-50/+2561
* oops * createSecretKey but weird error * use the right prototype, do not add a function called export lol * HMAC JWT export + base64 fix * Fix Equals, Fix Get KeySize, add complete export RSA * fix RSA export * add EC exports * X25519 and ED25519 export + fixes * fix default exports * better asymmetricKeyType * fix private exports * fix symmetricKeySize * createPublicKey validations + refactor * jwt + der fixes * oopsies * add PEM into createPublicKey * cleanup * WIP * bunch of fixes * public from private + private OKP * encrypted keys fixes * oops * fix clear tls error, add some support to jwk and other formats on publicEncrypt/publicDecrypt * more fixes and tests working * more fixes more tests * more clear hmac errors * more tests and fixes * add generateKeyPair * more tests passing, some skips * fix EC key from private * fix OKP JWK * nodejs ignores ext and key_ops on KeyObject.exports * add EC sign verify test * some fixes * add crypto.generateKeyPairSync(type, options) * more fixes and more tests * fix hmac tests * jsonwebtoken tests * oops * oops2 * generated files * revert package.json * vm tests * todos instead of failues * toBunString -> toString * undo simdutf * improvements * unlikely * cleanup * cleanup 2 * oops * move _generateKeyPairSync checks to native
2023-10-05WebCryptoAPI: remove JWK "EdDSA" alg checks (#6294)Gravatar Filip Skokan 1-2/+0
2023-10-04Create `AbortSignal` without JS (#6278)Gravatar Jarred Sumner 3-3/+18
* Create `AbortSignal` without JS * Don't leak --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-03Upgrade webkit (#6277)Gravatar Dylan Conway 3-8/+8
* `reportExtraMemoryAllocated` parameters changed * bump webkit * Update Dockerfile * format
2023-10-03compat: Buffer: allow optional positional arguments to be undefined (#4911)Gravatar Andrey Smirnov 1-14/+51
* fix `Buffer` compat with Node.js: compare * fix `Buffer` compat with Node.js: copy
2023-10-03feat(encoding): support BOM detection with test passed (#6074)Gravatar WingLim 2-1/+21
2023-10-02Warn at start when using AVX build of Bun without AVX support (#6242)Gravatar Jarred Sumner 1-1/+28
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-01fix(node:process): fix return value of `process.kill` (#6207)Gravatar Ai Hoshino 1-1/+1
2023-09-29Implement virtual module support in `Bun.plugin` (#6167)Gravatar Jarred Sumner 9-95/+357
* Add support for `build.module` in `Bun.plugin` * Another test * Update docs * Update isBuiltinModule.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-09-29fix(runtime): followup for `server.requestIP` (#6185)Gravatar dave caruso 2-6/+5
* fix(runtime): followup for `server.requestIP` * oops * yeah * sure * Update src/deps/libuwsockets.cpp * Update Dockerfile * lol --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29fix(resolver): support encoded file urls (#5766)Gravatar dave caruso 4-29/+79
* start working on this * it works now * better implementation imo * yippee * more tests and better unrefing * fix leak?
2023-09-29feat(runtime): implement `server.requestIp` + node:http `socket.address()` ↵Gravatar dave caruso 6-0/+229
(#6165) * [server] requestIp and AnyRequestContext Changed Request.uws_request to the new AnyRequestContext. This allows grabbing the IP from a Request. Unfinished. * [server] basic `requestIp` implementation Currently using uws's requestIpAsText, which always returns a ipv6 string. We should return a `SocketAddress` object to the user instead, which will contain the formatted address string and what type it is. We'll have to use requestIpAsBinary and parse that ourselves. * TypeScript docs, use `bun.String`, return `undefined` instead of `null` if we can't get the ip. * binary address formatting * uws getRemoteAddress binding * remove dead code * working * final touches:sparkles: * I will abide by the results of this poll. --------- Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com>
2023-09-28Upgrade to latest Node.js version (#6158)Gravatar Jarred Sumner 1-5/+5
* Upgrade to latest reported Node.js version * Upgrade --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28Reduce memory usage of HTTP server (#6135)Gravatar Jarred Sumner 1-0/+12
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28Get Next.js Pages Router to work (#6095)Gravatar dave caruso 5-105/+113
* hell * make it so bun-debug-src * teag * wild * yippee * fas * fix async hooks assertions * yap * yeah that's wild * aa * a * increase time allowed * so trivial
2023-09-27fix: implement correct behaviour for urls with blob: scheme (#5825)Gravatar Liz 1-1/+8
* fix: implement correct behaviour for urls with blob: scheme Urls using the blob scheme can have special behaviour if their origin itself is a url. This fixes that by parsing the subdomain and if valid and the schemes(protocols) are valid returns its origin. Ive used node.js here a lot to make sure its behaviour is copied 1:1 and enabled the automated tests for it. Fixes https://github.com/oven-sh/bun/issues/5805 * fix: subUrl can be const, we are not modifying it * style: add spaces after `if` keyword
2023-09-26fix: support console.dir options object correctly (#6059)Gravatar Liz 1-8/+28
* fix: support console,dir options object correctly `console.dir` can be passed a second argument which is a object of options. This implements that logic with the currently supported properties: `depth` and `colors`. I used node as a reference for implementation details. Fixes: https://github.com/oven-sh/bun/issues/6039 * style: format zig file * fix: implement changes from review Implements changes requested from review, like adding more test cases and refactoring code style.
2023-09-25no this value (#6063)Gravatar Dylan Conway 1-1/+1
2023-09-25Make error message for `new URL(invalid)` better (#6032)Gravatar Jarred Sumner 1-5/+15
* Make error message for `new URL(invalid)` better Thanks to @karlcow https://github.com/WebKit/WebKit/pull/13802 * redact --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24Fixes #5985 (#5986)Gravatar Jarred Sumner 2-2/+3
* Fixes #5985 * Update confirm-fixture.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-22Make this function inlineGravatar Jarred Sumner 1-1/+1
2023-09-21Implement module.parent (#5889)bun-v1.0.3Gravatar dave caruso 5-30/+70
* Make module.parent work * yay * oops * yay
2023-09-21fix #5865 (#5890)Gravatar Dylan Conway 1-1/+1
* make sure types are the same * tests
2023-09-21On Linux, respect memory limit from cgroups (#5849)Gravatar Jarred Sumner 2-56/+69
* Implement `process.constrainedMemory()` * Add a comment * Handle max * Missing header * We can use WTF::ramSize now * Update WebKit * Update ZigGlobalObject.cpp * WebKit * :scissors: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21Revert "feat(encoding): support BOM detection (#5550)"Gravatar Jarred Sumner 2-21/+1
This reverts commit 5f66b4e729105286863a13955b1ed8897b45210e. This caused test failures in text-encoder. cc @WingLim
2023-09-21Fixes #5859jarred/5859Gravatar Jarred Sumner 1-6/+13
2023-09-20fix: add check to sqlite extension loading logic (#5773)Gravatar Liz 2-0/+9
The sqlite3 logic to dynamically load extensions can be disabled to save space, which macos does by default. sqlite3 provides a api to check for these compile time settings at runtime, we can use that to throw a js error rather then crashing. It is worth noting though that the api to check for these settings at runtime itself can be disabled through SQLITE_OMIT_COMPILEOPTION_DIAGS but this seams to be a edge case.
2023-09-20fix(console.log): change default depth from 8 to 2 (#5839)Gravatar Jibran Kalia 1-1/+1
This make it as the same default depth in Node. Source: https://github.com/nodejs/node/blob/480ab8c3a40451d5ea459dd35b4039679b26e195/doc/api/console.md?plain=1#L285
2023-09-20fix(run): interpret extensionless files as typescript (#5711)Gravatar dave caruso 1-2/+2
* test * gadsgsagdsa * add better err msg * r * oops * ok
2023-09-20fix(ffi) fix size limit for dlopen (#5516)Gravatar Ciro Spaciari 1-1/+1
* fix size limit * 63 * throw error * ffi.test.js * add macos tests * oops
2023-09-20feat(encoding): support BOM detection (#5550)Gravatar WingLim 2-1/+21
* fix(encoding): export `getIgnoreBOM` * feat(encoding): support ignoreBOM * fix(encoding): not replace BOM to 0xFFFD * chore: use strict equal
2023-09-20feat(node:dns): implement `dns.lookupService` (#5613)Gravatar Ai Hoshino 1-0/+3
* feat(node:dns): implement dns.lookupService Close: #4347 * fix flags * add `getSockaddr` * fix sockaddr size * flaky test
2023-09-20implement `Module.prototype._compile` (#5840)Gravatar dave caruso 2-0/+59
2023-09-20feat(runtime): implement `console._stdout` (#5842)Gravatar dave caruso 1-1/+35
* implement console._stdout * nonenum
2023-09-20Call `Error.prepareStackTrace` on `new Error().stack` (#5802)Gravatar Jarred Sumner 4-144/+217
* Always call `Error.prepareStackTrace` * Support node:vm * Remove this * Handle more cases --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18fix(runtime/node): Allow `new Buffer.alloc()` + Upgrade WebKit (#5699)Gravatar dave caruso 2-20/+70
* make bufferconstructor a static hash table * chore: Upgrade WebKit to 4d995edbc44062b251be638818edcd88d7d14dd7 * make it constructable now * fix comment * yippee * update CI workflows
2023-09-18Implement `node_api_create_external_string_latin1` and ↵Gravatar Jarred Sumner 2-0/+79
`node_api_create_external_string_utf16` (#5675) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18feat(runtime): Implement `console.Console` (#5448)Gravatar dave caruso 1-1/+35
* prototype * asdfg * It works! * okay its done now fr * self review * ok * fix * fix test --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18In `bun:sqlite`, make sure we set the number tag correctly when creating the ↵Gravatar Jarred Sumner 1-5/+10
JSValue (#5655) * Make sure we set the number tag correctly when returning values from SQLite * Add DOMJIT test * Update JSSQLStatement.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18feat(test): Implement `arrayContaining` (#5572)Gravatar WingLim 9-2/+363
* feat(test): implement `arrayContaining` * feat: early return when expectedArray is empty * feat: add test for toEqual * chore: use `JSC::isArray` * chore: use getIndex for performance * fix: use deepEqual --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18feat(console.log): Print annonymus when class name is unknown (#5595)Gravatar Jibran Kalia 1-1/+1
This matches the functionality in Node.
2023-09-17Workaround #5604 (#5615)Gravatar Jarred Sumner 1-8/+12
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-16webkit upgrade (#5535)Gravatar Dylan Conway 8-10/+28
* update files * Update cold-jsc-start.cpp * bump webkit
2023-09-15Add missing visitorsbun-v1.0.2Gravatar Jarred Sumner 1-1/+3
cc @paperdave
2023-09-15feat(runtime): add `process.binding` `uv`/`natives`/`config` + make global ↵Gravatar dave caruso 24-1065/+1589
object properties lazy (#5355) * binding uv * we did that * some more bindings * fix doc * fix uv * yo * static hash table nonsense <3 * huge refactor to the global object i am not ready for merge conflicts * it works part 3 * lose --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-15Implement `URL.canParse` (#5463)Gravatar Jarred Sumner 3-2/+41
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15Does not fix #4622 (#5452)Gravatar Jarred Sumner 1-16/+25
* Fixes #4622 * cleanup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15Add missing `"size"` getter to `URLSearchParams` prototypeGravatar Jarred Sumner 1-0/+1