summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-29feat: add more Deno.errors classes (#19514)Bartek Iwańczuk
This commit adds following new error classes: - `Deno.errors.NotADirectory` - `Deno.errors.FilesystemLoop` - `Deno.errors.IsADirectory` - `Deno.errors.NetworkUnreachable` Closes https://github.com/denoland/deno/issues/19408
2023-06-28chore: Don't reconfigure storage on XL runners (#19641)Matt Mastracci
2023-06-28fix(test_ffi): thread_safe_callback is flaky (#19640)Aapo Alasuutari
Attempts to fix the thread_safe_callback flakiness. It's unclear what the flake is about, the exit code is apparently `C0000005` or `ACCESS_VIOLATION`, pointing to an issue with memory access. My only guess is that maybe dropping the `Option<extern "C" fn ()>` is somehow checking the validity of the function pointer and since the function has been dropped, the pointer is no longer valid and sometimes points to memory that should not be accessed. So now the will explicitly drop the functions before they get deallocated. If this doesn't fix the flake then something beyond my understanding is wrong.
2023-06-28chore: reconfigure windows builder storage (#19601)Matt Mastracci
Use `C:` drive to build on Windows, as `D:` is too limited.
2023-06-28fix(console): add assert function (#19635)Leo Kettmeir
2023-06-28fix(cli): Fix the bug where the command description is not displayed. (#19604)nasa
2023-06-27chore: update deno_lint to 0.48.0 (#19619)Bartek Iwańczuk
2023-06-27fix(kv): assertReject should always be awaited (#19612)Heyang Zhou
2023-06-27fix: lint on main branch (#19622)Bartek Iwańczuk
2023-06-27chore(ext/node): disable prefer-primordials on a per-file basis (#19553)Kenta Moriuchi
2023-06-27test(ext/node): port crypto_test.ts from deno_std (#19561)Felipe Baltor
2023-06-26feat(lock): skip saving declaration files in the lockfile (#19447)David Sherret
This is also a performance improvement because declaration file hashes don't need to be stored in the lockfile. Closes #19444
2023-06-26chore: Ensure copyright line is the first in the file (#19608)Matt Mastracci
The copyright checker was allowing files with code above the copyright line in a few places, mainly as a result of IDEs ordering imports improperly. This makes the check more robust, and adds a whitelist of valid lines that may appear before the copyright line.
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-26Revert "Reland "refactor(core): cleanup feature flags for js source i… ↵Bartek Iwańczuk
(#19611) …nclusion" (#19519)" This reverts commit 28a4f3d0f5383695b1d49ccdc8b0f799a715b2c2. This change causes failures when used outside Deno repo: ``` ============================================================ Deno has panicked. This is a bug in Deno. Please report this at https://github.com/denoland/deno/issues/new. If you can reliably reproduce this panic, include the reproduction steps and re-run with the RUST_BACKTRACE=1 env var set and include the backtrace in your report. Platform: linux x86_64 Version: 1.34.3+b37b286 Args: ["/opt/hostedtoolcache/deno/0.0.0-b37b286f7fa68d5656f7c180f6127bdc38cf2cf5/x64/deno", "test", "--doc", "--unstable", "--allow-all", "--coverage=./cov"] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failed to read "/home/runner/work/deno/deno/core/00_primordials.js" Caused by: No such file or directory (os error 2)', core/runtime/jsruntime.rs:699:8 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
2023-06-26test(ext/node): add fs read unit tests (#19588)Kaique da Silva
2023-06-26fix(ext/node): remove path.toFileUrl (#19536)Ryan Clements
2023-06-25fix(ops): quoting serde_v8::Value (#19593)Kangwook Lee (이강욱)
The following code: ```rust use deno_core::op; #[op] fn ops_serde_v8(value: serde_v8::Value) { // } fn main() { // } ``` ...with the following `Cargo.toml`: ```toml [package] name = "playground" version = "0.1.0" edition = "2021" [dependencies] deno_core = "0.191.0" serde_v8 = "0.102.0" ``` ...will not compile with the error: ``` error[E0433]: failed to resolve: use of undeclared crate or module `v8` --> src/main.rs:3:1 | 3 | #[op] | ^^^^^ use of undeclared crate or module `v8` | = note: this error originates in the attribute macro `op` (in Nightly builds, run with -Z macro-backtrace for more info) ``` This PR is fixing the above issue by properly quoting `deno_core::v8::Value` instead of `v8::Value`.
2023-06-25refactor(ops): ops2 supports result in fast path (#19603)Matt Mastracci
Implements `Result` in fast-calls. Note that the approach here is slightly different. Rather than store the last result in the `OpState`, we put it into the `OpCtx` which saves us a lookup and lock in the error case. We do not have to lock this field as it's guaranteed only one runtime and thread can ever access it. The fastcall path for many ops can avoid doing a great deal of work, even for `Result` return values. In the previous iteration of `ops`, all `Result`-returning functions would fetch and lock the `OpState`, regardless of whether it was used or not.
2023-06-25chore: disable /websocket/stream/tentative/close.any.worker.html?wss (#19606)Bartek Iwańczuk
This test is very flaky.
2023-06-25Reland "refactor(core): cleanup feature flags for js source inclusion" (#19519)Nayeem Rahman
Relands #19463. This time the `ExtensionFileSourceCode` enum is preserved, so this effectively just splits feature `include_js_for_snapshotting` into `exclude_js_sources` and `runtime_js_sources`, adds a `force_include_js_sources` option on `extension!()`, and unifies `ext::Init_ops_and_esm()` and `ext::init_ops()` into `ext::init()`.
2023-06-24refactor(ops): op2 supports Result in slow call path (#19602)Matt Mastracci
2023-06-24fix(ext/node): support brotli APIs (#19223)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-24fix(cli): Don't use hardcoded port 4501 in serve test (#19599)Matt Mastracci
2023-06-24refactor(ops): Adding op2 macro and implementing in a couple of places (#19534)Matt Mastracci
This is a new op system that will eventually replace `#[op]`. Features - More maintainable, generally less-coupled code - More modern Rust proc-macro libraries - Enforces correct `fast` labelling for fast ops, allowing for visual scanning of fast ops - Explicit marking of `#[string]`, `#[serde]` and `#[smi]` parameters. This first version of op2 supports integer and Option<integer> parameters only, and allows us to start working on converting ops and adding features.
2023-06-24chore(ext/web): align with whatwg/dom typo fix (#19584)Martin Fischer
The WHATWG DOM specification has corrected the spelling of "slotable" to "slottable".[1] This commit aligns our implementation accordingly. [1]: https://github.com/whatwg/dom/pull/845
2023-06-24bench: fix benchmarks (#19600)Bartek Iwańczuk
2023-06-24refactor: remove remaining references to ZeroCopyBuf (#19598)Bartek Iwańczuk
2023-06-23fix(serde_v8): Do not coerce values in serde_v8 (#19569)Divy Srivastava
Fixes #19568 Values are not coerced to the desired type during deserialisation. This makes serde_v8 stricter. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-23fix(ext/fs): fix boolean checks in JS parser (#19586)Luca Bruno
This fixes a bug in file metadata parsing logic, which now properly evaluates boolean fields when forwarding for atime / mtime / birthtime values. Ref: https://github.com/denoland/deploy_feedback/issues/409
2023-06-22refactor(serde_v8): split ZeroCopyBuf into JsBuffer and ToJsBuffer (#19566)Bartek Iwańczuk
`ZeroCopyBuf` was convenient to use, but sometimes it did hide details that some copies were necessary in certain cases. Also it made it way to easy for the caller to pass around and convert into different values. This commit splits `ZeroCopyBuf` into `JsBuffer` (an array buffer coming from V8) and `ToJsBuffer` (a Rust buffer that will be converted into a V8 array buffer). As a result some magical conversions were removed (they were never used) limiting the API surface and preparing for changes in #19534.
2023-06-22test(ext/node): port buffer_test.ts from deno_std (#19556)Felipe Baltor
2023-06-22refactor(npm): remove needless resolve_nv_ref_from_pkg_req_ref on ↵David Sherret
NpmResolver (#19582)
2023-06-22test(ext/node): add fs open unit test from std (#19505)Kaique da Silva
2023-06-21refactor(serde_v8): remove ZeropCopyBuf::Temp (#19563)Bartek Iwańczuk
Not used anymore.
2023-06-21fix(cli/napi): property with getter/setter always failed (#19562)Dj
with `napi_define_properties`.
2023-06-21fix(cli/napi): `napi_get_buffer_info` accepts `ArrayBufferView` … (#19551)Dj
... not just `Uint8Array`. This PR aligns behavior with Node.js Node-API implementation.
2023-06-19test(ext/node): port _fs_writeFile_test.ts from deno_std (#19524)Felipe Baltor
2023-06-19fix(deno/ext): Fix WebCrypto API's deriveKey (#19545)Santhanam
Fixes a bug I noticed when deriving a key based from `ECDH`. Similar issue is also mentioned in #14693, where they derive a key using `PBKDF2` - In the WebCrypto API, `deriveKey()` is equivalent to `deriveBits()` followed by `importKey()` - But, `deriveKey()` requires just `deriveKey` in the `usages` of the `baseKey` parameter. The `deriveBits` usage is not required to be allowed. This is the uniform behaviour in Node, Chrome and Firefox. - The impl currently has userland-accessible `SubtleCrypto.deriveKey()` and `SubtleCrypto.deriveBits()`, as well as an internal `deriveBits()` (this is the one that accesses the ffi). - Also, `SubtleCrypto.deriveKey()` checks if `deriveKey` is an allowed usage and `SubtleCrypto.deriveBits()` checks if `deriveBits` is an allowed usage, as required. - However, the impl currently calls the userland accessible `SubtleCrypto.deriveBits()` in `SubtleCrypto.deriveKey()`, leading to an error being thrown if the `deriveBits` usage isn't present. - Fixed this by making it call the internal `deriveBits()` instead.
2023-06-17chore(kv) fix and re-enable queue test (#19529)Igor Zinkovsky
The callback draining code is no longer needed after #19513.
2023-06-16chore: add conditional compilation for tokio_unstable feature (#19537)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19528
2023-06-16chore: fix typos in HrtimePermissionDescriptor and performance.now docs (#19469)andy
2023-06-16fix(ext/node): remove fromFileUrl from "node:path" (#19504)Ryan Clements
2023-06-16chore: forward v1.34.3 release commit to main (#19526)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-15fix(cli): avoid crash on import of invalid module names (#19523)Bartek Iwańczuk
Fixes https://github.com/denoland/deno/issues/17748 Closes #17770 Co-authored-by: Anton Bershanskiy <bershanskiy@users.noreply.github.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-06-15refactor(flags): move watch flags into subcommand structs (#19516)David Sherret
Moves the watch setting out of the `Flags` struct and into the individual subcommands
2023-06-15chore(ext/kv): disable flaky test (#19522)Heyang Zhou
2023-06-15refactor(ext/fetch): const for max header cache size (#19496)markthree
2023-06-15fix(node): Worker constructor doesn't check type: module of package.json ↵Vedant Pandey
(#19480)
2023-06-15refactor(ext/fetch): simplify fetch ops (#19494)Bartek Iwańczuk
Addresses feedback from https://github.com/denoland/deno/pull/19412#discussion_r1227912676