allow-await-in-a-func-def-assigned-to-default-param.js 594 B

1234567891011121314151617181920212223
  1. test('Do not throw syntax error when "await" is used in an arrow function definition assigned to a default function parameter', async () => {
  2. async function f(
  3. g = async () => {
  4. await 1;
  5. }
  6. ) {
  7. return await g();
  8. }
  9. expect(await f()).toBe(1);
  10. });
  11. test('Do not throw syntax error when "await" is used in a function definition assigned to a default function parameter', async () => {
  12. async function f(
  13. g = async function () {
  14. await 1;
  15. }
  16. ) {
  17. return await g();
  18. }
  19. expect(await f()).toBe(1);
  20. });