Age | Commit message (Collapse) | Author |
|
This commit changes REPL to never surface errors coming
from code execution, but instead print them as errors
to the REPL itself.
|
|
Co-authored-by: David Sherret <dsherret@gmail.com>
|
|
1. Extracts out some code from main.rs
2. Inlines all the `x_command` functions in main.rs
|
|
This commit changes "deno repl" command to run with no permissions by
default and accept "--allow-*" flags.
This change is dictated by the fact that currently there is no way to
run REPL with limited permissions. Technically it's a breaking
change in the CLI command, but there's agreement in the team
that it has merit and it's a good solution.
Running just "deno" command still starts the REPL with full permissions
allowed, but now a banner is printed to inform users about that:
|
|
This commit changes REPL behavior to respect --quiet flag. Once
this flag is present REPL will not print a banner at the start.
|
|
With trial and error I found that most debuggers expect "isDefault" to be sent
in "auxData" field of "executionContextCreated" notification. This stems from
the fact that Node.js sends this data and eg. VSCode requires it to close
connection to the debugger when the program finishes execution.
|
|
|
|
|
|
This commit changes history handling of the REPL.
There were some situations were history wasn't properly saved and flushed to a
file, making history very spotty. This commit changes it to save every line into
the history file and flush it to disk before being evaluated.
Thanks to this all lines, including "close()" will be stored in the history
file.
If for any reason we're not able to save history file, a single warning will be
printed to the REPL and it will continue to work, even if subsequent tries will
fail to save to disk.
|
|
|
|
|
|
|
|
|
|
There is a bug in rustyline with tabs on Windows, so we insert spaces for now.
|
|
|
|
|
|
This commit adds key binding for "ctrl+s"
combination that will force a new line in REPL.
|
|
|
|
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
|
|
This commit adds a clear() function in the REPL which works
similar to console.clear().
|
|
This commit adds support for "--eval-file" in "deno repl" subcommand.
This flag can be used to pass paths or URLs to files, that will be executed
on REPL startup. All files will be executed in the same context as the REPL
(ie. as "plain old scripts", not ES modules), sharing the global scope.
This feature allows to implement custom REPLs on top of Deno's REPL.
|
|
|
|
|
|
|
|
This reverts commit 382a978859a7a7a4351542be818bb2e59523429c.
|
|
|
|
|
|
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
|
|
|
|
|
|
Fixes "op_set_exit_code" by sharing a single "Arc" between
all workers (via "op state") instead of having a "global" value stored in
"deno_runtime" crate. As a consequence setting an exit code is always
scoped to a tree of workers, instead of being overridable if there are
multiple worker tree (like in "deno test --jobs" subcommand).
Refactored "cli/main.rs" functions to return "Result<i32, AnyError>" instead
of "Result<(), AnyError>" so they can return exit code.
|
|
|
|
|