chakra-core / chakra-core/ChakraCore

Review Implementation of Async/Await

Open
#5,293 14 comments 0 reactions 0 assignees View on GitHub
Task
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.