chakra-core / chakra-core/ChakraCore
Review Implementation of Async/Await
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
This code will log `1, 2, 3` on chakra. On v8, it will log `2, 3, 1`. Believe that the difference here is Chakra is not creating a new promise for the await. Spec section on [await](https://tc39.github.io/ecma262/#await) claims that we should be creating two new promises when we await, but we're only creating one.
```javascript
async function f2() {
return 1;
}
async function f1() {
let i = await f2();
console.log(i);
}
let p = f1();
Promise.resolve(2).then(() => {
console.log(2);
Promise.resolve(3).then(() => {
console.log(3);
});
});
```
Edit: My understanding from talking w/ folks is that Chakra's implementation of async/await predates the spec. It's currently a bit difficult to map the implementation to the spec language.
Contributor guide
Assessment
This issue has not been assessed yet.