summaryrefslogtreecommitdiff
path: root/runtime/js
AgeCommit message (Collapse)Author
2022-10-26feat: Stabilize Deno.consoleSize() API (#15933)Bartek Iwańczuk
This commit stabilizes "Deno.consoleSize()" API. There is one change compared to previous unstable API, in that the API doesn't accept any arguments. Console size is established by querying syscalls for stdio streams at fd 0, 1 and 2.
2022-10-25Revert "Revert "refactor(ext/net): clean up variadic network ops (#16… ↵Bartek Iwańczuk
(#16422) …392)" (#16417)" This reverts commit 8e3f825c921b38141afa7a69a0664881c5c94461.
2022-10-25feat: stabilize Deno.utime() and Deno.utimeSync() (#16421)Colin Ihrig
2022-10-25Revert "refactor(ext/net): clean up variadic network ops (#16392)" (#16417)Bartek Iwańczuk
Should fix https://github.com/denoland/deno_std/issues/2807
2022-10-25feat: stabilize Deno.futime() and Deno.futimeSync() (#16415)Colin Ihrig
2022-10-25feat: stabilize Deno.loadavg() (#16412)Colin Ihrig
2022-10-24experiment(ext/web): Don't expose event classes during the bootstrap phase ↵Andreu Botella
(#16213)
2022-10-24refactor(ext/net): clean up variadic network ops (#16392)Luca Casonato
Previously `op_net_listen`, `op_net_accept`, and various other ops in ext/net where variadic on the transport. This created a lot of code bloat. This commit updates the code to instead have separate ops for each transport.
2022-10-18feat: introduce navigator.language (#12322)Luca Matei Pintilie
Link to the spec: https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language-dev Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-17feat(unstable): add windowsRawArguments to SpawnOptions (#16319)Yoshiya Hinosawa
This change adds `windowsRawArguments` to `SpawnOptions`. The option enables skipping the default quoting and escaping while creating the command on windows. The option works in a similar way as `windowsVerbatimArguments` in child_process.spawn options in Node.js, and is necessary for simulating it in `std/node`. closes #8852
2022-10-10feat(core): add Deno.core.writeAll(rid, chunk) (#16228)Luca Casonato
This commit adds a new op_write_all to core that allows writing an entire chunk in a single async op call. Internally this calls `Resource::write_all`. The `writableStreamForRid` has been moved to `06_streams.js` now, and uses this new op. Various other code paths now also use this new op. Closes #16227
2022-09-30refactor(ext/http): remove op_http_read (#16096)Luca Casonato
We can use Resource::read_return & op_read instead. This allows HTTP request bodies to participate in FastStream. To make this work, `readableStreamForRid` required a change to allow non auto-closing resources to be handled. This required some minor changes in our FastStream paths in ext/http and ext/flash.
2022-09-30fix(runtime): no FastStream for unrefable streams (#16095)Luca Casonato
2022-09-29fix: move Deno.hostname() from denoNsUnstable to denoNs (#16086)TrickyPi
2022-09-28feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28feat: add --allow-sys permission flag (#16028)Yoshiya Hinosawa
2022-09-28feat: implement Web Cache API (#15829)Satya Rohith
2022-09-28refactor(runtime): don't use destructuring assignment in JS code (#16050)Bartek Iwańczuk
2022-09-27feat: Add requesting API name to permission prompt (#15936)Bartek Iwańczuk
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2022-09-27feat: Stabilize Deno.refTimer() and Deno.unrefTimer() APIs (#16036)Bartek Iwańczuk
2022-09-23perf: use fast ops for tty (#15976)Divy Srivastava
2022-09-22perf: fs optimizations - part 1 (#15873)Divy Srivastava
2022-09-17perf(ext/console): avoid `wrapConsole` when not inspecting (#15931)Divy Srivastava
2022-09-16fix(runtime): fix permission status cache keys (#15899)Nayeem Rahman
2022-09-15refactor(runtime/io): use primordials (#15906)Marcos Casagrande
2022-09-06perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)Divy Srivastava
2022-09-05perf(runtime): flatten arguments for write_file ops (#15776)Divy Srivastava
2022-09-02refactor(test): grab runTests() and runBenchmarks() from __bootstrap (#15420)Nayeem Rahman
2022-08-24feat(ext/flash): split upgradeHttp into two APIs (#15557)Luca Casonato
This commit splits `Deno.upgradeHttp` into two different APIs, because the same API is currently overloaded with two different functions. Flash requests upgrade immediately, with no need to return a `Response` object. Instead you have to manually write the response to the socket. Hyper requests only upgrade once a `Response` object has been sent. These two behaviours are now split into `Deno.upgradeHttp` and `Deno.upgradeHttpRaw`. The latter is flash only. The former only supports hyper requests at the moment, but can be updated to support flash in the future. Additionally this removes `void | Promise<void>` as valid return types for the handler function. If one wants to use `Deno.upgradeHttpRaw`, they will have to type cast the handler signature - the signature is meant for the 99.99%, and should not be complicated for the 0.01% that use `Deno.upgradeHttpRaw()`.
2022-08-21feat: `queueMicrotask()` error handling (#15522)Nayeem Rahman
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158).
2022-08-19feat(unstable): change Deno.serve() API (#15498)Bartek Iwańczuk
- Merge "Deno.serve()" and "Deno.serveTls()" API - Remove first argument and use "fetch" field options instead - Update type declarations - Add more documentation
2022-08-19perf(runtime): optimize Deno.file open & stream (#15496)Divy Srivastava
2022-08-18feat(ext/flash): An optimized http/1.1 server (#15405)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-08-10fix: allow setting `globalThis.location` when no `--location` is provided ↵Kayla Washburn
(#15448)
2022-08-05fix: various formatting fixes (#15412)David Sherret
2022-08-04fix: Update `Object.prototype.__proto__` related comments (#15394)Yongwook Choi
2022-07-23fix: unhandledrejection handling for sync throw in top level (#15279)Bartek Iwańczuk
Fixes an edge in "unhandledrejection" event that prevent synchronous errors being surfaced when throw from a top-level scope.
2022-07-22fix: Child.unref() unrefs stdio streams properly (#15275)Bartek Iwańczuk
2022-07-20Reland "feat: add "unhandledrejection" event support" (#15211)Bartek Iwańczuk
2022-07-18feat(unstable): Ability to ref/unref "Child" in "Deno.spawnChild()" API (#15151)Leo Kettmeir
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-18BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)Nayeem Rahman
- "SpawnOutput" extends "ChildStatus" instead of composing it - "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", "Child::stdout" and "Child::stderr" are no longer optional, instead made them getters that throw at runtime if that stream wasn't set to "piped". - Remove the complicated "<T extends SpawnOptions = SpawnOptions>" which we currently need to give proper type hints for the availability of these fields. Their typings for these would get increasingly complex if it became dependent on more options (e.g. "SpawnOptions::pty" which if set should make the stdio streams unavailable)
2022-07-15refactor: allocate IDs for tests (#14729)Nayeem Rahman
2022-07-15Revert "feat: add "unhandledrejection" event support (#12994) (#15080)" (#15210)Bartek Iwańczuk
This reverts commit 1a7259b04b7229f6350a7a7c21b50497b5c80c17.
2022-07-14feat: add "unhandledrejection" event support (#12994) (#15080)Bartek Iwańczuk
Relanding #12994 This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-04Revert "feat: add "unhandledrejection" event support (#12994)" (#15075)Bartek Iwańczuk
This reverts commit f7af0b01a59aaac91473e2f920137004d39a310a.
2022-07-04feat: add "unhandledrejection" event support (#12994)Bartek Iwańczuk
This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-06-28fix(test): typo ('finsihed') if text decoder not closed during test (#14996)nkronlage
fix: typo ('finsihed') if text decoder not closed during test
2022-06-28feat(web): add beforeunload event (#14830)Colin Ihrig
This commit adds the 'beforeunload' event. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-24fix: don't error if Deno.bench() or Deno.test() are used in run subcommand ↵Bartek Iwańczuk
(#14946)