diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-28 23:07:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 23:07:23 +0100 |
commit | f526513d74d34ac254aa40ef9b73238cb21c395b (patch) | |
tree | 066e2c3685e33f611d2d38b04d49b01e4604573a /core/modules.rs | |
parent | fd51b2e506f3ea3cc49bfb2bcb19bc684f563f60 (diff) |
feat(core): show unresolved promise origin (#16650)
This commit updates unhelpful messages that are raised when event loop
stalls on unresolved top-level promises.
Instead of "Module evaluation is still pending but there are no pending
ops or dynamic imports. This situation is often caused by unresolved
promises." and "Dynamically imported module evaluation is still pending
but there are no pending ops. This situation is often caused by
unresolved promises." we are now printing a message like:
error: Top-level await promise never resolved
[SOURCE LINE]
^
at [FUNCTION NAME] ([FILENAME])
eg:
error: Top-level await promise never resolved
await new Promise((_resolve, _reject) => {});
^
at <anonymous>
(file:///Users/ib/dev/deno/cli/tests/testdata/test/unresolved_promise.ts:1:1)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'core/modules.rs')
-rw-r--r-- | core/modules.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modules.rs b/core/modules.rs index 8d0ae9733..1041f44f8 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -754,8 +754,8 @@ pub(crate) enum ModuleError { pub(crate) struct ModuleMap { // Handling of specifiers and v8 objects ids_by_handle: HashMap<v8::Global<v8::Module>, ModuleId>, - handles_by_id: HashMap<ModuleId, v8::Global<v8::Module>>, - info: HashMap<ModuleId, ModuleInfo>, + pub handles_by_id: HashMap<ModuleId, v8::Global<v8::Module>>, + pub info: HashMap<ModuleId, ModuleInfo>, by_name: HashMap<(String, AssertedModuleType), SymbolicModule>, next_module_id: ModuleId, next_load_id: ModuleLoadId, |