1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 12:58:54 -05:00

fix(core): Fix incorrect index in Promise.all error reporting (#8913)

This commit is contained in:
Deepanshu Utkarsh 2020-12-29 09:24:19 -05:00 committed by GitHub
parent 24844a0052
commit 115de4c81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
const p = Promise.all([
Promise.resolve(),
(async (): Promise<never> => {
await Promise.resolve();
throw new Error("Promise.all()");

View file

@ -1,8 +1,8 @@
[WILDCARD]Error: Promise.all()
at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD]
at async Promise.all (index 0)
at async Promise.all (index 1)
at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD]
error: Uncaught Error: Promise.all()
at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD]
at async Promise.all (index 0)
at async Promise.all (index 1)
at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD]

View file

@ -293,7 +293,7 @@ impl JsError {
.unwrap();
let is_promise_all = is_promise_all.is_true();
let promise_index: Option<v8::Local<v8::Integer>> =
get_property(scope, call_site, "columnNumber")
get_property(scope, call_site, "promiseIndex")
.unwrap()
.try_into()
.ok();