summaryrefslogtreecommitdiff
path: root/cli/ops/errors.rs
AgeCommit message (Collapse)Author
2022-05-17BREAKING: Remove unstable Deno.emit and Deno.formatDiagnostics APIs (#14463)Bartek Iwańczuk
2022-05-03refactor: add core.formatLocationFilename, remove op_format_filename (#14474)Bartek Iwańczuk
This commit moves "op_format_location" to "core/ops_builtin.rs" and removes "Deno.core.createPrepareStackTrace" in favor of "Deno.core.prepareStackTrace". Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-04-15refactor: Move source map lookups to core (#14274)Nayeem Rahman
The following transformations gradually faced by "JsError" have all been moved up front to "JsError::from_v8_exception()": - finding the first non-"deno:" source line; - moving "JsError::script_resource_name" etc. into the first error stack in case of syntax errors; - source mapping "JsError::script_resource_name" etc. when wrapping the error even though the frame locations are source mapped earlier; - removing "JsError::{script_resource_name,line_number,start_column,end_column}" entirely in favour of "js_error.frames.get(0)". We also no longer pass a js-side callback to "core/02_error.js" from cli. I avoided doing this on previous occasions because the source map lookups were in an awkward place.
2022-03-16feat(ops): optional OpState (#13954)Aaron O'Mullan
2022-03-14feat(ops): custom arity (#13949)Aaron O'Mullan
Also cleanup & drop ignored wildcard op-args
2022-03-14feat(core): codegen ops (#13861)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-12-29cleanup(cli): use op Extensions (#13223)Aaron O'Mullan
Enabling op-middleware for overrides in lieu of imperative .replace_op() etc... Impacts #13219, #12938, #13122
2021-10-05chore: various op cleanup (#12329)Leo K
2021-09-24refactor: Rename ProgramState to ProcState (#12204)Ryan Dahl
Move Arc into struct
2021-09-18fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127)Nayeem Rahman
Co-authored-by: Mike White <mike.white@auctane.com>
2021-05-08cleanup(ops): remove unused ZeroCopyBuf arg-types (#10530)Aaron O'Mullan
2021-04-12refactor(deno): remove concept of bin & json ops (#10145)Aaron O'Mullan
2021-04-02refactor(ops): remove variadic buffers (#9944)Aaron O'Mullan
2021-02-26feat(cli/source_map): Use top user frame for error source lines (#9604)Nayeem Rahman
This commit changes formatting of JS errors; by not showing source lines for internal code. Where possible, instead using the top stack frame associated with user code i.e. the first location that is colourful and not a "deno:" URL.
2021-01-11chore: update copyright to 2021 (#9092)Yusuke Tanaka
2021-01-06fix: use inline source maps when present in js (#8995)Luca Casonato
2020-12-11refactor(cli): decouple ops from ProgramState and Flags (#8659)Bartek Iwańczuk
This commit does major refactor of "Worker" and "WebWorker", in order to decouple them from "ProgramState" and "Flags". The main points of interest are "create_main_worker()" and "create_web_worker_callback()" functions which are responsible for creating "Worker" and "WebWorker" in CLI context. As a result it is now possible to factor out common "runtime" functionality into a separate crate.
2020-10-23refactor(cli): migrate run and cache to new infrastructure (#7996)Kitson Kelly
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-13refactor(cli): rename GlobalState to ProgramState (#7914)Bartek Iwańczuk
2020-09-21refactor: use futures and serde_json from deno_core (#7614)Bartek Iwańczuk
2020-09-20refactor: remove CliState, use OpState, add CliModuleLoader (#7588)Bartek Iwańczuk
- remove "CliState.workers" and "CliState.next_worker_id", instead store them on "OpState" using type aliases. - remove "CliState.global_timer" and "CliState.start_time", instead store them on "OpState" using type aliases. - remove "CliState.is_internal", instead pass it to Worker::new - move "CliState::permissions" to "OpState" - move "CliState::main_module" to "OpState" - move "CliState::global_state" to "OpState" - move "CliState::check_unstable()" to "GlobalState" - change "cli_state()" to "global_state()" - change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks - rename "CliState" to "CliModuleLoader"
2020-09-16Remove unnecessary serde_derive dependencyRyan Dahl
2020-09-15refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)Bert Belder
2020-09-12refactor: improve tsc diagnostics (#7420)Kitson Kelly
2020-09-10Use gotham-like state for ops (#7385)Ryan Dahl
Provides a concrete state type that can be dynamically added. This is necessary for op crates. * renames BasicState to OpState * async ops take `Rc<RefCell<OpState>>` * sync ops take `&mut OpState` * removes `OpRegistry`, `OpRouter` traits * `get_error_class_fn` moved to OpState * ResourceTable moved to OpState
2020-09-06Move JSON ops to deno_core (#7336)Bert Belder
2020-08-28refactor: migrate ops to new dispatch wrapper (#7118)Bartek Iwańczuk
2020-08-26refactor: remove OpError, use ErrBox everywhere (#7187)Bert Belder
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-19Make Rc/Arc wrapper around State/GlobalState visible (#7104)Bert Belder
2020-06-01feat(core): Ops can take several zero copy buffers (#4788)Valentin Anger
2020-05-05refactor(ts): remove op_cache (#5071)Bartek Iwańczuk
This PR removes op_cache and refactors how Deno interacts with TS compiler. Ultimate goal is to completely sandbox TS compiler worker; it should operate on simple request -> response basis. With this commit TS compiler no longer caches compiled sources as they are generated but rather collects all sources and sends them back to Rust when compilation is done. Additionally "Diagnostic" and its children got refactored to use "Deserialize" trait instead of manually implementing JSON deserialization.
2020-04-23Rename deno_core::Isolate to deno_core::CoreIsolate (#4851)Ryan Dahl
2020-04-13refactor(core/js_error): Align JSStackFrame with CallSite (#4715)Nayeem Rahman
Renames and adds missing fields to JSStackFrame from CallSite. Fixes #4705. Cleans up base changes for line and column numbers.
2020-03-02Do not convert exceptions to JSON and back (#4214)Bert Belder
2020-02-25Clean up how we use opIds (#4118)Ryan Dahl
2020-02-24feat: Add Deno.formatDiagnostics (#4032)Kitson Kelly
2020-02-23refactor: use OpError instead of ErrBox for errors in ops (#4058)Bartek Iwańczuk
To better reflect changes in error types in JS from #3662 this PR changes default error type used in ops from "ErrBox" to "OpError". "OpError" is a type that can be sent over to JSON; it has all information needed to construct error in JavaScript. That made "GetErrorKind" trait useless and so it was removed altogether. To provide compatibility with previous use of "ErrBox" an implementation of "From<ErrBox> for OpError" was added, however, it is an escape hatch and ops implementors should strive to use "OpError" directly.
2020-02-08refactor: rename ThreadSafeState, use RefCell for mutable state (#3931)Bartek Iwańczuk
* rename ThreadSafeState to State * State stores InnerState wrapped in Rc and RefCell
2020-01-24s/PinnedBuf/ZeroCopyBuf (#3782)Ryan Dahl
2020-01-05Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)Ry Dahl
2020-01-02Happy new year! (#3578)Ry Dahl
2019-12-23Upgrades rust to 1.40.0 (#3542)Axetroy
2019-11-04Refactor Worker and ThreadSafeState (#3242)Bartek Iwańczuk
* Split ThreadSafeState into State and GlobalState. State is a "local" state belonging to "Worker" while "GlobalState" is state shared by whole program. * Update "Worker" and ops to use "GlobalState" where applicable * Move and refactor "WorkerChannels" resource
2019-10-11Add init methods for each op module (#3087)Ryan Dahl
2019-08-26bring back json ops (#2815)Bartek Iwańczuk
2019-08-24Revert json ops (#2814)Ryan Dahl
* Revert "port more ops to JSON (#2809)" This reverts commit 137f33733d365026903d40e7cde6e34ac6c36dcf. * Revert "port ops to JSON: compiler, errors, fetch, files (#2804)" This reverts commit 79f82cf10ed1dbf91346994250d7311a4d74377a. * Revert "Port rest of os ops to JSON (#2802)" This reverts commit 5b2baa5c990fbeae747e952c5dcd7a5369e950b1.
2019-08-24port ops to JSON: compiler, errors, fetch, files (#2804)Bartek Iwańczuk
2019-08-21Organize dispatch a bit (#2796)Ryan Dahl
Just some clean up reorganization around flatbuffer/minimal dispatch code. This is prep for adding a JSON dispatcher.
2019-08-14split up ops.rs (#2753)Bartek Iwańczuk
Note cli/dispatch_minimal.rs ops are not yet included in cli/ops. This is part of work towards #2730