summaryrefslogtreecommitdiff
path: root/cli/tests
AgeCommit message (Collapse)Author
2022-10-27Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443)Divy Srivastava
2022-10-27perf(core): generate inlined wrappers for async ops (#16428)Divy Srivastava
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
2022-10-27fix(typescript): allow synthetic default imports when using ↵David Sherret
`ModuleKind.ESNext` (#16438) Closes #16437
2022-10-26chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)Colin Ihrig
This commit renames `Deno.getUid()` to `Deno.uid()` and renames `Deno.getGid()` to `Deno.gid()`.
2022-10-26feat(ext/net): reusePort for TCP on Linux (#16398)Luca Casonato
2022-10-26fix(compile): show an error when using npm specifiers (#16430)David Sherret
Closes #16427
2022-10-26chore: improve built-in API documentation (#16158)Kitson Kelly
Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Colin Ihrig <cjihrig@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-26feat(cli): show error cause recursion information (#16384)Cre3per
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-25fix: listenTlsWithReuseAddr test (#16420)Bartek Iwańczuk
2022-10-25chore: fix flaky esm_module_deno_test test (#16419)David Sherret
2022-10-25fix(npm): add support for npm packages in lock files (#15938)Bartek Iwańczuk
This commit adds support for npm packages in the lock file.
2022-10-25fix: upgrade swc_ecma_parser to 0.122.19 - deno_ast 0.20 (#16406)David Sherret
2022-10-25feat: stabilize Deno.loadavg() (#16412)Colin Ihrig
2022-10-25feat(ext/web): use ArrayBuffer.was_detached() (#16307)Marcos Casagrande
This PR adds a way to reliably check if an ArrayBuffer was detached
2022-10-25feat(lint): add a report lint config setting (#16045)Brenley Dueck
Builds off this PR to add a "report" setting to deno.json which can be "pretty", "compact", or "json".
2022-10-24perf(ext/web): add op_encode_binary_string (#16352)Marcos Casagrande
Add a new op to use in `reader.readAsBinaryString(blob)`. ``` File API binary string: 400b 35.12 µs/iter (21.93 µs … 3.27 ms) 31.87 µs 131.95 µs 217.63 µs File API binary string: 4kb 46.49 µs/iter (29.36 µs … 4.42 ms) 42.5 µs 122.48 µs 155.1 µs File API binary string: 2.2mb 4.17 ms/iter (1.75 ms … 8.54 ms) 5.48 ms 7.39 ms 8.54 ms ``` **main** ``` benchmark time (avg) (min … max) p75 p99 p995 --------------------------------------------------------------------- ----------------------------- File API binary string: 400b 56.17 µs/iter (43.09 µs … 784.52 µs) 49.6 µs 177.18 µs 241.23 µs File API binary string: 4kb 277.2 µs/iter (240.29 µs … 1.84 ms) 269.87 µs 649.79 µs 774.46 µs File API binary string: 2.2mb 180.03 ms/iter (173.32 ms … 194.35 ms) 182.54 ms 194.35 ms 194.35 ms ``` It can also handle bigger files, when encoding a 200mb file, main crashes with OOM ``` <--- Last few GCs ---> [132677:0x560504676550] 5012 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; [132677:0x560504676550] 5038 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; [132677:0x560504676550] 5064 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms (average mu = 0.824, current mu = 0.825) allocation failure; ```
2022-10-24feat: Stabilize Deno.stdin.setRaw() (#16399)Bartek Iwańczuk
2022-10-24perf(ext/streams): fast path when consuming body of tee'd stream (#16329)Marcos Casagrande
Add a fast path for consuming the body of cloned `Request`/`Response`, which is very common specially when using `cache` API.
2022-10-24feat(ext/net): add reuseAddress option for UDP (#13849)Gianluca Oldani
This commit adds a `reuseAddress` option for UDP sockets. When this option is enabled, one can listen on an address even though it is already being listened on from a different process or thread. The new socket will steal the address from the existing socket. On Windows and Linux this uses the `SO_REUSEADDR` option, while on other Unixes this is done with `SO_REUSEPORT`. This behavior aligns with what libuv does. TCP sockets still unconditionally set the `SO_REUSEADDR` flag - this behavior matches Node.js and Go. This PR does not change this behaviour. Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-10-24fix(ext/net): don't remove sockets on unix listen (#16394)Luca Casonato
When listening on a UNIX socket path, Deno currently tries to unlink this path prior to actually listening. The implementation of this behaviour is VERY racy, involves 2 additional syscalls, and does not match the behaviour of any other runtime (Node.js, Go, Rust, etc). This commit removes this behaviour. If a user wants to listen on an existing socket, they must now unlink the file themselves prior to listening. This change in behaviour only impacts --unstable APIs, so it is not a breaking change.
2022-10-21feat(unstable/npm): initial type checking of npm specifiers (#16332)David Sherret
2022-10-20fix(lsp): allow caching deps in non-saved files (#16353)David Sherret
2022-10-20feat(ext/ffi): Make op_ffi_ptr_of fast (#16297)Aapo Alasuutari
Makes `op_ffi_ptr_of` fast. One of the tests changed from printing `false` to `true` as the fast `&[u8]` slice path creates the slice with a null pointer. Thus the `op_ffi_ptr_of` will now return a null pointer value whereas previously it returned a dangling pointer value.
2022-10-20perf(ext/ffi): Fast UnsafePointerView read functions (#16351)Aapo Alasuutari
This PR makes pointer read methods of `Deno.UnsafePointerView` Fast API compliant, with the exception of `getCString` which cannot be made fast with current V8 Fast API.
2022-10-19feat: Add new lockfile format (#16349)Bartek Iwańczuk
Introduces a new lockfile format that will be used to support locking "npm" dependencies. Currently the format looks as follows: ``` // This file is automatically generated by Deno, do not edit its contents // manually. This file should be commited to your repository. { "version": "2", "remote": { "https://deno.land/std@0.160.0/http/server.ts": "asdwetsw44523asdfgfas..", "https://deno.land/std@0.160.0/http/file_server.ts": "asdwetsw44523asdfgfas.." } } ``` A follow up PR will add "npm" key that will be used to store information related to "npm" dependencies and their resolution. The new format is used when `--lock-write` is present, if user tries to load a lock file using the old format it will still work.
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-18feat(task): remove warning about being unstable (#16281)Bartek Iwańczuk
`deno task` has been in use for a few months now. It was very well received and there are not many complaints. I feel like this warning might be discouraging for some users and we don't really plan to make drastic changes to it (besides adding support for globs in unspecified future).
2022-10-18test(crypto): update crypto.getRandomValues calls (#16338)Filip Skokan
[`crypto.getRandomValues`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) does not return a Promise.
2022-10-18fix(ext/net): return an error from `startTls` and `serveHttp` if the ↵Yusuke Tanaka
original connection is captured elsewhere (#16242) This commit removes the calls to `expect()` on `std::rc::Rc`, which caused Deno to panic under certain situations. We now return an error if `Rc` is referenced by other variables. Fixes #9360 Fixes #13345 Fixes #13926 Fixes #16241 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-17chore: upgrade internal deno_std to 0.160 (#16333)David Sherret
2022-10-17feat(unstable/npm): support providing npm dist-tag in npm package specifier ↵David Sherret
(#16293)
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-16fix: add error cause in recursive cause tail (#16306)Cre3per
2022-10-16fix(ext/cache): illegal constructor (#16205)Marcos Casagrande
2022-10-16feat: support inlay hints (#16287)Kitson Kelly
Closes: #11853
2022-10-15feat(unstable/task): add `INIT_CWD` env var (#16110)David Sherret
2022-10-15fix(ext/crypto): correct HMAC get key length op (#16201)Filip Skokan
fixes #16180 `HMAC`'s `get key length` `op` uses the hash function's block size, not output size. refs https://github.com/cloudflare/workerd/issues/68#issuecomment-1271189657
2022-10-14fix(lsp): properly handle snippets on completions (#16274)Kitson Kelly
Fixes #15367
2022-10-13chore: Added onbeforeunload to window type definition (#16251)Matt Ezell
2022-10-10fix(ext/fetch): fix illegal header regex (#16236)Marcos Casagrande
This PR fixes invalid header parsing which is flaky because `g` flag is being used in the regex, which keeps track of `lastIndex` ```javascript try { new Headers([["x", "\u0000x"]]); // error } catch(e) {} new Headers([["x", "\u0000x"]]); // no error ``` This issue affects `Response` & `Request` constructors as well
2022-10-10fix sparse array inspection (#16204)sigmaSd
fix https://github.com/denoland/deno/issues/16202
2022-10-09feat(core): improve resource read & write traits (#16115)Luca Casonato
This commit introduces two new buffer wrapper types to `deno_core`. The main benefit of these new wrappers is that they can wrap a number of different underlying buffer types. This allows for a more flexible read and write API on resources that will require less copying of data between different buffer representations. - `BufView` is a read-only view onto a buffer. It can be backed by `ZeroCopyBuf`, `Vec<u8>`, and `bytes::Bytes`. - `BufViewMut` is a read-write view onto a buffer. It can be cheaply converted into a `BufView`. It can be backed by `ZeroCopyBuf` or `Vec<u8>`. Both new buffer views have a cursor. This means that the start point of the view can be constrained to write / read from just a slice of the view. Only the start point of the slice can be adjusted. The end point is fixed. To adjust the end point, the underlying buffer needs to be truncated. Readable resources have been changed to better cater to resources that do not support BYOB reads. The basic `read` method now returns a `BufView` instead of taking a `ZeroCopyBuf` to fill. This allows the operation to return buffers that the resource has already allocated, instead of forcing the caller to allocate the buffer. BYOB reads are still very useful for resources that support them, so a new `read_byob` method has been added that takes a `BufViewMut` to fill. `op_read` attempts to use `read_byob` if the resource supports it, which falls back to `read` and performs an additional copy if it does not. For Rust->JS reads this change should have no impact, but for Rust->Rust reads, this allows the caller to avoid an additional copy in many scenarios. This combined with the support for `BufView` to be backed by `bytes::Bytes` allows us to avoid one data copy when piping from a `fetch` response into an `ext/http` response. Writable resources have been changed to take a `BufView` instead of a `ZeroCopyBuf` as an argument. This allows for less copying of data in certain scenarios, as described above. Additionally a new `Resource::write_all` method has been added that takes a `BufView` and continually attempts to write the resource until the entire buffer has been written. Certain resources like files can override this method to provide a more efficient `write_all` implementation.
2022-10-05fix(ext/cache): prevent cache insert if body is not fully written (#16138)Marcos Casagrande
2022-10-05fix(ext/flash): Avoid sending Content-Length when status code is 204 (#15901)ayame113
Currently Content-Length is sent when the status code is 204. However, according to the spec, this should not be sent. Modify the if statement below to prevent the Content-Length from being sent.
2022-10-04perf(ext/fetch): consume body using ops (#16038)Marcos Casagrande
This commit adds a fast path to `Request` and `Response` that make consuming request bodies much faster when using `Body#text`, `Body#arrayBuffer`, and `Body#blob`, if the body is a FastStream. Because the response bodies for `fetch` are FastStream, this speeds up consuming `fetch` response bodies significantly.
2022-10-04chore: remove 'fix_exotic_specifier' test (#16143)Bartek Iwańczuk
It's a test that's been flaky for a week, and after offline discussion, we're no longer sure what it's testing.
2022-10-04fix(ext/crypto): interoperable import/export (#16153)Filip Skokan
This PR updates RSA key import/export to a state which is interoperable with other implementations. For RSA the only OID in and out is `rsaEncryption`. For EC the only OID in and out is `id-ecpublickey` (fixed in #16152). see https://github.com/w3c/webcrypto/issues/307#issuecomment-995813032 see https://github.com/w3c/webcrypto/issues/307 see https://github.com/w3c/webcrypto/pull/305 see https://github.com/nodejs/node/pull/42816
2022-10-04fix(ext/crypto): ecdh spki key import/export roundtrip (#16152)Filip Skokan
2022-10-03fix(ext/crypto): deriveBits for ECDH not taking length into account (#16128)Aurélien Bertron
Fixes #16047