Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases for async function and async generator edge-cases #2096

Merged
merged 6 commits into from
Mar 13, 2019

Conversation

anba
Copy link
Contributor

@anba anba commented Mar 11, 2019

Test cases for https://bugzilla.mozilla.org/show_bug.cgi?id=1530754 and other related issues I found (or found again), like tc39/ecma262#1474 and tc39/ecma262#1470, while working on that bug.

SpiderMonkey passes these tests locally with https://bugzilla.mozilla.org/show_bug.cgi?id=1530754 fixed. (Some of the tests fail on V8/JSC, so don't be surprised if you see any errors.)

.then(() => actual.push("tick 1"))
.then(() => actual.push("tick 2"))
.then(() => {
assert.compareArray(actual, expected, "Ticks for implicit and explicit return undefined");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually test the return values, does it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, it doesn't test that each of the async generators actually returns undefined. But that was actually intentional, because the test should only ensure that the async generators finish at the correct turn. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that sounds right :) Then the assertion text should be changed.

"get return",

// "then" of `received.[[Value]]` accessed.
"get then",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow! This is tricky

@leobalter leobalter merged commit 8e2a07d into tc39:master Mar 13, 2019
@anba anba deleted the asynciter-fx branch June 25, 2020 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants