consider code
;(async () => {
const o = {
f: async () => {
const x = await Promise.resolve(1)
o.y = 3
return x
},
}
console.log({
x: await o.f(),
y: o.y,
})
})()
will output
{ x: 1, y: 3 }
But if we change order of object field definition to
...
console.log({
y: o.y,
x: await o.f(),
})
...
result will be
{ y: undefined, x: 1 }
The question is: is this behavior guaranteed? I mean if sequence will be
like
console.log({
x: await o.f(),
y: o.y,
})
would result always be like
{ x: 1, y: 3 }
and never like
{ y: undefined, x: 1 }
?
Thanks
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.