Age | Commit message (Collapse) | Author |
|
This commit moves following tools into a single "tools"
module located at "cli/tools/mod.rs":
- formatter
- linter
- test runner
- coverage collector
- installer
- binary upgrader
- repl
|
|
|
|
Fixes #8240
|
|
Previously, entering a single ']' would cause repl to forever accepting
new lines, due to that `ValidationResult::Invalid` would actually be
consumed by the editor itself while continue building the lines. Instead
we should mark it as `Valid` and send the bad input for evaluation to
get the proper error from V8.
Before:
```
> ]
(you can keep entering new line here, and it will never consume input
until you Ctrl-C)
```
After:
```
> ]
Uncaught SyntaxError: Unexpected token ']'
>
```
|
|
This commit adds tab completion in REPL.
Currently it works only for global identifiers and object properties.
|
|
|
|
This adds the grave character to the pair matching so that template
string literals trigger multi-line edits.
|
|
This changes the behavior of keyboard interrupts (ctrl+c) to continue,
clearing the current line instead of exiting.
Exit can still be done with ctrl+d or by calling close().
|
|
This writes all evaluaton results to stdout regardless if the result is
an error or not.
This matches the behavior of other read-eval-print-loops like Node.
|
|
This extracts is closing into a function so that it can easily be used
as the condition for the loop.
|
|
|
|
This extracts prelude injection into a helper function and moves the
prelude string literal into a top level static string to help trim some
of the fat out of the run function.
|
|
This commit adds a simple regex replace based highlighter
to the REPL editor.
It tries to match the color palette of Deno.inspect()
|
|
|
|
This takes the execution context id from a notification which is sent on
Runtime.enable rather than hard-coding it to a magic value.
|
|
|
|
* Revert "refactor: Worker is not a Future (#7895)"
This reverts commit f4357f0ff9d39411f22504fcc20db6bd5dec6ddb.
* Revert "refactor(core): JsRuntime is not a Future (#7855)"
This reverts commit d8879feb8c832dbb38649551b1cb0730874f7be6.
* Revert "fix(core): module execution with top level await (#7672)"
This reverts commit c7c767782538243ded64742dca9b34d6af74d62d.
|
|
This commit rewrites deno::Worker to not implement Future
trait.
Instead there are two separate methods:
- Worker::poll_event_loop() - does single tick of event loop
- Worker::run_event_loop() - runs event loop to completion
Additionally some cleanup to Worker's field visibility was done.
|
|
This changes the signature of InspectorSession.post_message to take a
&str rather than a String avoiding the need call str.to_string at each
call site.
|
|
|
|
|
|
This enables `replMode` during evaluations which allows for top level
await and let re-declarations.
|
|
This ports the REPL over to Rust and makes use of an inspector session to run a REPL on top of any isolate which lets make full use of rustylines various things like validators and completors without having to introduce a bunch of hard to test internal ops and glue code.
An accidental but good side effect of this is that the multiple line input we previously had is now an editable multi-line input prompt that is correctly stored in the history as a single entry.
|
|
|
|
|
|
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
This is in preperation for dynamic import (#1789), which is more easily
implemented when errors are dynamic.
|
|
|
|
|
|
To better distinguish the deno_core crate from the executable deno,
which will now be called "the cli" internally.
|