Version
18.5.0
Platform
Linux 5.13.0-Ubuntu x86_64 x86_64 x86_64 GNU/Linux
Subsystem
repl
What steps will reproduce the bug?
In REPL:
const foo = async () => 123;
foo();
await foo();
typeof (await Promise.resolve(foo))();
(await Promise.resolve(foo))();
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
> const foo = async () => 123;
undefined
> foo();
Promise {
123,
[Symbol(async_id_symbol)]: 33,
[Symbol(trigger_async_id_symbol)]: 5
}
> await foo();
123
> typeof (await Promise.resolve(foo))();
'object'
> (await Promise.resolve(foo))();
Promise {
123,
[Symbol(async_id_symbol)]: 108,
[Symbol(trigger_async_id_symbol)]: 5
}
Note that typeof prints 'object', which is correct and matches Promise { ... }.
What do you see instead?
> const foo = async () => 123;
undefined
> foo();
Promise {
123,
[Symbol(async_id_symbol)]: 33,
[Symbol(trigger_async_id_symbol)]: 5
}
> await foo();
123
> typeof (await Promise.resolve(foo))();
'object'
> (await Promise.resolve(foo))();
123
Note that typeof prints 'object', which is correct, but the value of the expression is shown to be 123 in the REPL, which is a 'number'.
Additional information
Chrome and Edge seem to handle this as I'd expect. Firefox seems to handle this like Node.js (so I'm assuming it's a bug).
Version
18.5.0
Platform
Linux 5.13.0-Ubuntu x86_64 x86_64 x86_64 GNU/Linux
Subsystem
repl
What steps will reproduce the bug?
In REPL:
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
Note that
typeofprints'object', which is correct and matchesPromise { ... }.What do you see instead?
Note that
typeofprints'object', which is correct, but the value of the expression is shown to be123in the REPL, which is a'number'.Additional information
Chrome and Edge seem to handle this as I'd expect. Firefox seems to handle this like Node.js (so I'm assuming it's a bug).