summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
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
2021-10-12chore: bump crate version for 1.15.0 (#12406)Satya Rohith
2021-10-12feat: update to V8 9.5 (#12399)Luca Casonato
2021-10-10refactor(metrics): move to core (#12386)Aaron O'Mullan
Avoids overhead of wrapping ops (and allocs when inspecting async-op futures)
2021-10-10bench(deno_common): track void ops (#12389)Aaron O'Mullan
To track overhead through the entire CLI opcall stack (metrics included, etc...)
2021-10-10feat: Show the URL of streaming WASM modules in stack traces (#12268)Andreu Botella
WebAssembly modules compiled through `WebAssembly.compile()` and similar non-streaming APIs don't have a URL associated to them, because they have been compiled from a buffer source. In stack traces, V8 will use a URL such as `wasm://wasm/d1c677ea`, with a hash of the module. However, wasm modules compiled through streaming APIs, like `WebAssembly.compileStreaming()`, do have a known URL, which can be obtained from the `Response` object passed into the streaming APIs. And as per the developer-facing display conventions in the WebAssembly Web API spec, this URL should be used in stack traces. This change implements that.
2021-10-07feat(core): cleaner opcall stack traces (#12358)Aaron O'Mullan
2021-10-05feat(core): native binding names (#12290)Aaron O'Mullan
Makes native builtin functions easier to recognize when debugging/profiling, they would otherwise appear as "(anonymous)" functions
2021-10-05chore: various op cleanup (#12329)Leo K
2021-10-05chore: merge v1.14.3 into main (#12327)Bartek Iwańczuk
2021-10-04refactor(core): split opcall into sync/async (#12312)Aaron O'Mullan
2021-10-04fix(core/runtime): sync_ops_cache if nuked Deno ns (#12302)Aaron O'Mullan
Decouple JsRuntime::sync_ops_cache() from the availability of the Deno.* namespace in the global scope This avoids crashes when calling sync_ops_cache() on a bootstrapped WebWorker who has dropped its Deno.* namespace It's also just cleaner and more robust ...
2021-10-03perf(core): use opcall() directly (#12310)Aaron O'Mullan
Instead of the wrapper dispatch() func, also now forbids passing opIds to opSync()/opAsync() callers must always pass names