-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): Refactor execution & microtasks into
CliRunner
struct
In order to add a repl to the cli, #323 moved the `initialize_global_object` and `exit_with_parse_errors` functions into a new `helper` module. However, this still left duplicate code between the `eval` and `repl` commands. This patch moves the isolate and realm initialization, as well as the script execution and microtask checkpoint, to a new `CliRunner` struct that lives in the `helper` module. Aside from just refactoring, this patch makes two visible changes related to promise jobs: - When passing multiple files to `eval`, now promise jobs run after each script execution, rather than at the end. - In `repl` mode it used to be that promise jobs were never run. Now, all promise jobs enqueued when running a line of JS are run before the result is printed.
- Loading branch information
1 parent
ff05681
commit 192a470
Showing
4 changed files
with
129 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters