summaryrefslogtreecommitdiff
path: root/core/01_core.js
AgeCommit message (Collapse)Author
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-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-07refactor(core): Move Deno.core bindings to ops (#14793)Nayeem Rahman
2022-05-24fix(core): op metrics op_names mismatch (#14716)Aaron O'Mullan
2022-04-08refactor(core): OpCtx (#14228)Aaron O'Mullan
2022-03-21fix(core): variadic opSync/opAsync (#14062)Aaron O'Mullan
2022-03-19chore(core,ext): minor JS optimisations (#13950)Aapo Alasuutari
2022-03-14feat(core): codegen ops (#13861)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-12refactor(core): validate promise id in refOp (#13905)Yoshiya Hinosawa
2022-02-25feat: deno test --trace-ops (#13770)Bartek Iwańczuk
This commit adds "--trace-ops" flag to "deno test" subcommand. This flag enables saving of stack traces for async ops, that before were always saved. While the feature proved to be very useful it comes with a significant performance hit, it's caused by excessive source mapping of stack frames.
2022-02-16feat(test): improved op sanitizer errors + traces (#13676)Luca Casonato
This commit improves the error messages for the `deno test` async op sanitizer. It does this in two ways: - it uses handwritten error messages for each op that could be leaking - it includes traces showing where each op was started This "async op tracing" functionality is a new feature in deno_core. It likely has a significant performance impact, which is why it is only enabled in tests.
2022-02-01refactor: primordials for instanceof (#13527)Bartek Iwańczuk
2022-01-27Revert "refactor: update runtime code for primordial checks for "instanceof" ↵Bartek Iwańczuk
(#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
2022-01-27refactor: update runtime code for primordial checks for "instanceof" (#13497)Bartek Iwańczuk
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
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-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-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-10-10refactor(metrics): move to core (#12386)Aaron O'Mullan
Avoids overhead of wrapping ops (and allocs when inspecting async-op futures)
2021-10-07feat(core): cleaner opcall stack traces (#12358)Aaron O'Mullan
2021-10-04refactor(core): split opcall into sync/async (#12312)Aaron O'Mullan
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
2021-09-10perf(ext/http): optimize auto cleanup of request resource (#11978)Bert Belder
Fixes #11963.
2021-08-19cleanup(core): rename handleAsyncMsgFromRust() to opresolve() (#11774)Aaron O'Mullan
No user impact, but is simpler and aligns with `opcall()`
2021-07-02refactor: introduce primordials (#10939)Luca Casonato
This commit introduces primordials to deno_core. Primordials are a frozen set of all intrinsic objects in the runtime. They are not vulnerable to prototype pollution.