Commit Graph

2 Commits

Author SHA1 Message Date
André Bargull 100b3b4afe Add missing includes for await tests (#1874) 2018-10-18 12:02:25 -04:00
Maya Lekova b98c45ca5a AsyncFunction: Add tests ensuring the new 1-tick await behaviour (#1843)
* AsyncFunction: Add tests ensuring the new 1-tick await behaviour

This commit adds 3 tests ensuring the optimized behaviour of await
(see https://github.com/tc39/ecma262/pull/1250) in the following cases:
- async functions
- yielding from async generator functions
- for-await-of loops

* AsyncFunction: Add tests ensuring the monkey-patched promises behaviour

This commit adds 2 more tests ensuring the optimized behaviour of await
(see tc39/ecma262#1250) in the following cases:
- awaiting on a native promise with monkey-patched "then"
- awaiting on a non-native promise (a "thenable" object)

* AsyncFunction: Add tests ensuring the non-native promises behaviour

This commit adds 1 more tests ensuring the optimized behaviour of await
(see tc39/ecma262#1250) in the following cases:
- awaiting on a non-promise, non-thenable object

It also renames the previous test for non-promise (a "thenable" object)
to distinguish from the new case.

The commit adds checks for proper await/promises interleaving in the
aforementioned cases and includes a small code clean-up.

* AsyncFunction: Refactor tests ensuring the new 1-tick await behaviour

Gather all the tests to their appropriate folder and update copyright header.
2018-10-17 16:10:09 -04:00