summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2022-01-04chore: upgrade v8 from 9.7 to 9.8 (#13269)Ben Noordhuis
2021-12-30fix(core): inspector works if no "Runtime.runIfWaitingForDebugger" message ↵Bartek Iwańczuk
is sent (#13191) This commit changes flow in inspector code to no longer require "Runtime.runIfWaitingForDebugger" message to complete a handshake. Even though clients like Chrome DevTools always send this message on startup, it is against the protocol to require this message to start an inspector session. Instead "Runtime.runIfWaitingForDebugger" is required only when running with "--inspect-brk" flag, which matches behavior of Node.js.
2021-12-30chore(core): remove stale TODOs (#13232)Bartek Iwańczuk
2021-12-30fix(doc): Make private types which show up in the rustdocs public (#13230)Andreu Botella
`CrossIsolateStore`, `ExtensionBuilder` and `InMemoryChannelResource` are private types which are referred to by other public APIs, and so don't show up as links in the rustdoc. This is especially confusing for `ExtensionBuilder`, since there is nothing in the docs that explains how to build an extension. Exposing these three types doesn't add any new capabilities: `ExtensionBuilder` can be created from `Extension::builder()`, `SharedArrayBufferStore` and `CompiledWasmModuleStore` already enable doing anything that `CrossIsolateStore` can do by itself, and `InMemoryChannelResource` isn't constructable.
2021-12-29feat: output `cause` on JS runtime errors (#13209)Leo Kettmeir
2021-12-29cleanup(core): use Extensions to register ops (#13224)Aaron O'Mullan
In examples and tests
2021-12-28refactor(core): cleanup Inspector implementation (#12962)Bartek Iwańczuk
2021-12-22chore: merge v1.17.1 into main (#13184)Bartek Iwańczuk
2021-12-21refactor: Cleanup core/modules.rs (#13149)Bartek Iwańczuk
2021-12-18refactor: use `once_cell` instead of `lazy_static` (#13135)Divy Srivastava
2021-12-16chore: release crates for v1.17.0 (#13112)Bartek Iwańczuk
2021-12-15feat: Add support for import assertions and JSON modules (#12866)Bartek Iwańczuk
This commit adds proper support for import assertions and JSON modules. Implementation of "core/modules.rs" was changed to account for multiple possible module types, instead of always assuming that the code is an "ES module". In effect "ModuleMap" now has knowledge about each modules' type (stored via "ModuleType" enum). Module loading pipeline now stores information about expected module type for each request and validates that expected type matches discovered module type based on file's "MediaType". Relevant tests were added to "core/modules.rs" and integration tests, additionally multiple WPT tests were enabled. There are still some rough edges in the implementation and not all WPT were enabled, due to: a) unclear BOM handling in source code by "FileFetcher" b) design limitation of Deno's "FileFetcher" that doesn't download the same module multiple times in a single run Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2021-12-13example(core): add example for FS module loading (#13064)Bartek Iwańczuk
2021-12-12fix(core): improve error on invalid op id (#13056)Bartek Iwańczuk
2021-12-08fix: upgrade swc fixing many bundling and `--no-check` bugs (#13025)David Sherret
2021-12-04chore: upgrade to Rust 1.57.0 (#12968)Bartek Iwańczuk
2021-12-04chore: merge v1.16.4 into main (#12984)Luca Casonato
2021-12-03chore: update to rusty v8 0.36.0 (#12979)Luca Casonato
2021-12-03fix(core): throw on invalid callConsole args (#12973)Aaron O'Mullan
Instead of panicking via asserts, since JS-callable code (even Deno.core ...) should not cause process crashes/panics
2021-12-01chore: Fix typo in no-pending-ops error message (#12948)KnorpelSenf
2021-11-30fix(core): Wake up the runtime if there are ticks scheduled (#12933)Andreu Botella
2021-11-28feat(core): intercept unhandled promise rejections (#12910)Ben Noordhuis
Provide a programmatic means of intercepting rejected promises without a .catch() handler. Needed for Node compat mode. Also do a first pass at uncaughtException support because they're closely intertwined in Node. It's like that Frank Sinatra song: you can't have one without the other. Stepping stone for #7013.
2021-11-25feat(core): Add ability to "ref" and "unref" pending ops (#12889)Bartek Iwańczuk
This commit adds an ability to "ref" or "unref" pending ops. Up to this point Deno had a notion of "async ops" and "unref async ops"; the former keep event loop alive, while the latter do not block event loop from finishing. It was not possible to change between op types after dispatching, one had to decide which type to use before dispatch. Instead of storing ops in two separate "FuturesUnordered" collections, now ops are stored in a single collection, with supplemental "HashSet" storing ids of promises that were "unrefed". Two APIs were added to "Deno.core": "Deno.core.refOp(promiseId)" which allows to mark promise id to be "refed" and keep event loop alive (the default behavior) "Deno.core.unrefOp(promiseId)" which allows to mark promise id as "unrefed" which won't block event loop from exiting
2021-11-24chore: merge v1.16.3 into main (#12892)Bert Belder
2021-11-22core(examples): Deserialize the result of execute_script (#12806)Giacomo Rizzi
Example of transforming execute_script response to a serde_json::Value Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-11-22fix(core): don't panic when evaluating module after termination (#12833)Bartek Iwańczuk
2021-11-19fix(core): keep event loop alive if there are ticks scheduled (#12814)Ben Noordhuis
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-11-17upgrade: v8 crate 0.35.0 (V8 9.7.106.5) (#12797)Bert Belder
Fixes: #11406
2021-11-17chore: bump crates for 1.16.2 (#12792)David Sherret
2021-11-16feat(core): Deno.core.setNextTickCallback (#12771)Bartek Iwańczuk
This commit adds several new "Deno.core" bindings: * "setNextTickCallback" * "hasScheduledTick" * "setHasScheduledTick" * "runMicrotasks" Additionally it changes "Deno.core.setMacrotaskCallback" to allow registering multiple callbacks. All these changes were necessary to polyfill "process.nextTick" in Node compat layer. Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-11-16refactor: re-export anyhow from deno_core (#12777)Ryan Dahl
2021-11-11chore: bump crate versions for 1.16.1 (#12729)Luca Casonato
2021-11-09feat(core): streams (#12596)Aaron O'Mullan
This allows resources to be "streams" by implementing read/write/shutdown. These streams are implicit since their nature (read/write/duplex) isn't known until called, but we could easily add another method to explicitly tag resources as streams. `op_read/op_write/op_shutdown` are now builtin ops provided by `deno_core` Note: this current implementation is simple & straightforward but it results in an additional alloc per read/write call Closes #12556
2021-11-09chore: bump crate versions for 1.16.0 (#12706)Luca Casonato
2021-11-08perf(core): optimize waker capture in AsyncRefCell (#12332)Bert Belder
2021-11-08feat: update to V8 9.7 (#12685)Luca Casonato
This commit updates the rusty_v8 to 0.34.0. This commit also adds the required typings for the new Array#findLast and Array#findIndexLast methods.
2021-11-08feat(compat): add .code to dyn import error (#12633)Yoshiya Hinosawa
2021-11-04feat(runtime): give OS errors .code attributes (#12591)Aaron O'Mullan
This adds `.code` attributes to errors returned by the op-layer, facilitating classifying OS errors and helping node-compat. Similar to Node, these `.code` attributes are stringified names of unix ERRNOs, the mapping tables are generated by [tools/codegen_error_codes.js](https://gist.github.com/AaronO/dfa1106cc6c7e2a6ebe4dba9d5248858) and derived from libuv and rust's std internals
2021-11-03fix: Deno.emit crashes with BorrowMutError (#12627)Ryan Dahl
Warn on await_holding_refcell_ref clippy rule to avoid this in the future. Fixes #12453
2021-11-02chore: update to Rust edition 2021 (#12578)Bartek Iwańczuk
2021-10-27chore: update to rusty_v8 0.33.0 (#12564)Luca Casonato
2021-10-25chore: bump crate version for 1.15.3 (#12531)Yoshiya Hinosawa
2021-10-24cleanup(core): AsyncOpIterator (#11860)Aaron O'Mullan
2021-10-24fix(core): avoid op_state.borrow_mut() for OpsTracker (#12525)Aaron O'Mullan
By allowing interior mutability in OpsTracker (owning a RefCell<Vec> instead of just a Vec) Fixes #12453
2021-10-20feat(serde_v8): allow all values to deserialize to unit type (#12504)Aaron O'Mullan
2021-10-20feat(serde_v8): StringOrBuffer (#12503)Aaron O'Mullan
2021-10-19fix(core/bindings): use is_instance_of_error() instead of is_native_error() ↵Nayeem Rahman
(#12479)
2021-10-18chore: release crates for v1.15.2 (#12478)Bartek Iwańczuk
2021-10-17fix(core): poll async ops eagerly (#12385)Bert Belder
Currently all async ops are polled lazily, which means that op initialization code is postponed until control is yielded to the event loop. This has some weird consequences, e.g. ```js let listener = Deno.listen(...); let conn_promise = listener.accept(); listener.close(); // `BadResource` is thrown. A reasonable error would be `Interrupted`. let conn = await conn_promise; ``` JavaScript promises are expected to be eagerly evaluated. This patch makes ops actually do that.
2021-10-17fix(core): avoid polling future after cancellation (#12385)Bert Belder