One can await
a non-Promise and that's good so.
All these expressions are valid and cause no error:
await 5
await 'A'
await {}
await null
await undefined
Is there any detectable effect of awaiting a non-Promise? Is there any difference in behavior one should be aware of to avoid a potential error? Any performance differences?
Are the following two lines completely same or do they theoretically differ?:
var x = 5
var x = await 5
How? Any example to demonstrate the difference?
PS: According TypeScript authors, there is a difference:
var x = await 5;
is not the same asvar x = 5;
;var x = await 5;
will assign x 5 in the next tern, where asvar x = 5;
will evaluate immediately.