From 281c8902a6a71dee5098ee30c5c13cc503145ffd Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 18 Nov 2016 00:22:26 -0800 Subject: [PATCH] ES5 tests for async generators --- .../asyncGenerators.classMethod.1.es5.js | 54 ++++++++++++ .../asyncGenerators.classMethod.1.es5.symbols | 8 ++ .../asyncGenerators.classMethod.1.es5.types | 8 ++ ...ncGenerators.classMethod.10.es5.errors.txt | 18 ++++ .../asyncGenerators.classMethod.10.es5.js | 70 +++++++++++++++ .../asyncGenerators.classMethod.11.es5.js | 64 ++++++++++++++ ...asyncGenerators.classMethod.11.es5.symbols | 10 +++ .../asyncGenerators.classMethod.11.es5.types | 11 +++ .../asyncGenerators.classMethod.12.es5.js | 64 ++++++++++++++ ...asyncGenerators.classMethod.12.es5.symbols | 10 +++ .../asyncGenerators.classMethod.12.es5.types | 12 +++ .../asyncGenerators.classMethod.13.es5.js | 70 +++++++++++++++ ...asyncGenerators.classMethod.13.es5.symbols | 10 +++ .../asyncGenerators.classMethod.13.es5.types | 12 +++ .../asyncGenerators.classMethod.14.es5.js | 71 +++++++++++++++ ...asyncGenerators.classMethod.14.es5.symbols | 15 ++++ .../asyncGenerators.classMethod.14.es5.types | 16 ++++ .../asyncGenerators.classMethod.15.es5.js | 64 ++++++++++++++ ...asyncGenerators.classMethod.15.es5.symbols | 10 +++ .../asyncGenerators.classMethod.15.es5.types | 12 +++ ...ncGenerators.classMethod.16.es5.errors.txt | 11 +++ .../asyncGenerators.classMethod.16.es5.js | 64 ++++++++++++++ ...ncGenerators.classMethod.17.es5.errors.txt | 11 +++ .../asyncGenerators.classMethod.17.es5.js | 60 +++++++++++++ ...ncGenerators.classMethod.18.es5.errors.txt | 14 +++ .../asyncGenerators.classMethod.18.es5.js | 60 +++++++++++++ .../asyncGenerators.classMethod.19.es5.js | 67 +++++++++++++++ ...asyncGenerators.classMethod.19.es5.symbols | 11 +++ .../asyncGenerators.classMethod.19.es5.types | 14 +++ .../asyncGenerators.classMethod.2.es5.js | 53 ++++++++++++ .../asyncGenerators.classMethod.2.es5.symbols | 7 ++ .../asyncGenerators.classMethod.2.es5.types | 7 ++ ...ncGenerators.classMethod.20.es5.errors.txt | 14 +++ .../asyncGenerators.classMethod.20.es5.js | 60 +++++++++++++ ...ncGenerators.classMethod.21.es5.errors.txt | 13 +++ .../asyncGenerators.classMethod.21.es5.js | 58 +++++++++++++ ...ncGenerators.classMethod.22.es5.errors.txt | 10 +++ .../asyncGenerators.classMethod.22.es5.js | 58 +++++++++++++ .../asyncGenerators.classMethod.3.es5.js | 53 ++++++++++++ .../asyncGenerators.classMethod.3.es5.symbols | 7 ++ .../asyncGenerators.classMethod.3.es5.types | 7 ++ ...yncGenerators.classMethod.4.es5.errors.txt | 18 ++++ .../asyncGenerators.classMethod.4.es5.js | 55 ++++++++++++ ...yncGenerators.classMethod.5.es5.errors.txt | 18 ++++ .../asyncGenerators.classMethod.5.es5.js | 55 ++++++++++++ ...yncGenerators.classMethod.6.es5.errors.txt | 9 ++ .../asyncGenerators.classMethod.6.es5.js | 56 ++++++++++++ ...yncGenerators.classMethod.7.es5.errors.txt | 12 +++ .../asyncGenerators.classMethod.7.es5.js | 56 ++++++++++++ .../asyncGenerators.classMethod.8.es5.js | 67 +++++++++++++++ .../asyncGenerators.classMethod.8.es5.symbols | 12 +++ .../asyncGenerators.classMethod.8.es5.types | 12 +++ ...yncGenerators.classMethod.9.es5.errors.txt | 15 ++++ .../asyncGenerators.classMethod.9.es5.js | 69 +++++++++++++++ ...yncGenerators.functionDeclaration.1.es5.js | 46 ++++++++++ ...nerators.functionDeclaration.1.es5.symbols | 4 + ...Generators.functionDeclaration.1.es5.types | 4 + ...tors.functionDeclaration.10.es5.errors.txt | 16 ++++ ...ncGenerators.functionDeclaration.10.es5.js | 63 ++++++++++++++ ...ncGenerators.functionDeclaration.11.es5.js | 57 ++++++++++++ ...erators.functionDeclaration.11.es5.symbols | 6 ++ ...enerators.functionDeclaration.11.es5.types | 7 ++ ...ncGenerators.functionDeclaration.12.es5.js | 57 ++++++++++++ ...erators.functionDeclaration.12.es5.symbols | 6 ++ ...enerators.functionDeclaration.12.es5.types | 8 ++ ...ncGenerators.functionDeclaration.13.es5.js | 63 ++++++++++++++ ...erators.functionDeclaration.13.es5.symbols | 6 ++ ...enerators.functionDeclaration.13.es5.types | 8 ++ ...ncGenerators.functionDeclaration.14.es5.js | 63 ++++++++++++++ ...erators.functionDeclaration.14.es5.symbols | 7 ++ ...enerators.functionDeclaration.14.es5.types | 9 ++ ...ncGenerators.functionDeclaration.15.es5.js | 57 ++++++++++++ ...erators.functionDeclaration.15.es5.symbols | 6 ++ ...enerators.functionDeclaration.15.es5.types | 8 ++ ...tors.functionDeclaration.16.es5.errors.txt | 9 ++ ...ncGenerators.functionDeclaration.16.es5.js | 57 ++++++++++++ ...tors.functionDeclaration.17.es5.errors.txt | 9 ++ ...ncGenerators.functionDeclaration.17.es5.js | 53 ++++++++++++ ...tors.functionDeclaration.18.es5.errors.txt | 9 ++ ...ncGenerators.functionDeclaration.18.es5.js | 53 ++++++++++++ ...ncGenerators.functionDeclaration.19.es5.js | 60 +++++++++++++ ...erators.functionDeclaration.19.es5.symbols | 7 ++ ...enerators.functionDeclaration.19.es5.types | 10 +++ ...yncGenerators.functionDeclaration.2.es5.js | 46 ++++++++++ ...nerators.functionDeclaration.2.es5.symbols | 4 + ...Generators.functionDeclaration.2.es5.types | 4 + ...tors.functionDeclaration.20.es5.errors.txt | 9 ++ ...ncGenerators.functionDeclaration.20.es5.js | 53 ++++++++++++ ...yncGenerators.functionDeclaration.3.es5.js | 46 ++++++++++ ...nerators.functionDeclaration.3.es5.symbols | 4 + ...Generators.functionDeclaration.3.es5.types | 4 + ...ators.functionDeclaration.4.es5.errors.txt | 13 +++ ...yncGenerators.functionDeclaration.4.es5.js | 48 +++++++++++ ...ators.functionDeclaration.5.es5.errors.txt | 13 +++ ...yncGenerators.functionDeclaration.5.es5.js | 48 +++++++++++ ...ators.functionDeclaration.6.es5.errors.txt | 7 ++ ...yncGenerators.functionDeclaration.6.es5.js | 49 +++++++++++ ...ators.functionDeclaration.7.es5.errors.txt | 7 ++ ...yncGenerators.functionDeclaration.7.es5.js | 49 +++++++++++ ...yncGenerators.functionDeclaration.8.es5.js | 60 +++++++++++++ ...nerators.functionDeclaration.8.es5.symbols | 8 ++ ...Generators.functionDeclaration.8.es5.types | 8 ++ ...ators.functionDeclaration.9.es5.errors.txt | 13 +++ ...yncGenerators.functionDeclaration.9.es5.js | 62 +++++++++++++ ...syncGenerators.functionExpression.1.es5.js | 46 ++++++++++ ...enerators.functionExpression.1.es5.symbols | 4 + ...cGenerators.functionExpression.1.es5.types | 5 ++ ...ators.functionExpression.10.es5.errors.txt | 16 ++++ ...yncGenerators.functionExpression.10.es5.js | 63 ++++++++++++++ ...yncGenerators.functionExpression.11.es5.js | 57 ++++++++++++ ...nerators.functionExpression.11.es5.symbols | 6 ++ ...Generators.functionExpression.11.es5.types | 8 ++ ...yncGenerators.functionExpression.12.es5.js | 57 ++++++++++++ ...nerators.functionExpression.12.es5.symbols | 6 ++ ...Generators.functionExpression.12.es5.types | 9 ++ ...yncGenerators.functionExpression.13.es5.js | 63 ++++++++++++++ ...nerators.functionExpression.13.es5.symbols | 6 ++ ...Generators.functionExpression.13.es5.types | 9 ++ ...yncGenerators.functionExpression.14.es5.js | 63 ++++++++++++++ ...nerators.functionExpression.14.es5.symbols | 7 ++ ...Generators.functionExpression.14.es5.types | 10 +++ ...yncGenerators.functionExpression.15.es5.js | 57 ++++++++++++ ...nerators.functionExpression.15.es5.symbols | 6 ++ ...Generators.functionExpression.15.es5.types | 9 ++ ...ators.functionExpression.16.es5.errors.txt | 9 ++ ...yncGenerators.functionExpression.16.es5.js | 57 ++++++++++++ ...ators.functionExpression.17.es5.errors.txt | 9 ++ ...yncGenerators.functionExpression.17.es5.js | 53 ++++++++++++ ...ators.functionExpression.18.es5.errors.txt | 9 ++ ...yncGenerators.functionExpression.18.es5.js | 53 ++++++++++++ ...yncGenerators.functionExpression.19.es5.js | 60 +++++++++++++ ...nerators.functionExpression.19.es5.symbols | 7 ++ ...Generators.functionExpression.19.es5.types | 11 +++ ...syncGenerators.functionExpression.2.es5.js | 46 ++++++++++ ...enerators.functionExpression.2.es5.symbols | 4 + ...cGenerators.functionExpression.2.es5.types | 5 ++ ...syncGenerators.functionExpression.3.es5.js | 46 ++++++++++ ...enerators.functionExpression.3.es5.symbols | 4 + ...cGenerators.functionExpression.3.es5.types | 5 ++ ...rators.functionExpression.4.es5.errors.txt | 10 +++ ...syncGenerators.functionExpression.4.es5.js | 46 ++++++++++ ...rators.functionExpression.5.es5.errors.txt | 10 +++ ...syncGenerators.functionExpression.5.es5.js | 46 ++++++++++ ...rators.functionExpression.6.es5.errors.txt | 7 ++ ...syncGenerators.functionExpression.6.es5.js | 49 +++++++++++ ...rators.functionExpression.7.es5.errors.txt | 7 ++ ...syncGenerators.functionExpression.7.es5.js | 49 +++++++++++ ...syncGenerators.functionExpression.8.es5.js | 60 +++++++++++++ ...enerators.functionExpression.8.es5.symbols | 8 ++ ...cGenerators.functionExpression.8.es5.types | 9 ++ ...rators.functionExpression.9.es5.errors.txt | 13 +++ ...syncGenerators.functionExpression.9.es5.js | 62 +++++++++++++ ...yncGenerators.objectLiteralMethod.1.es5.js | 51 +++++++++++ ...nerators.objectLiteralMethod.1.es5.symbols | 8 ++ ...Generators.objectLiteralMethod.1.es5.types | 9 ++ ...tors.objectLiteralMethod.10.es5.errors.txt | 18 ++++ ...ncGenerators.objectLiteralMethod.10.es5.js | 67 +++++++++++++++ ...ncGenerators.objectLiteralMethod.11.es5.js | 61 +++++++++++++ ...erators.objectLiteralMethod.11.es5.symbols | 10 +++ ...enerators.objectLiteralMethod.11.es5.types | 12 +++ ...ncGenerators.objectLiteralMethod.12.es5.js | 61 +++++++++++++ ...erators.objectLiteralMethod.12.es5.symbols | 10 +++ ...enerators.objectLiteralMethod.12.es5.types | 13 +++ ...ncGenerators.objectLiteralMethod.13.es5.js | 67 +++++++++++++++ ...erators.objectLiteralMethod.13.es5.symbols | 10 +++ ...enerators.objectLiteralMethod.13.es5.types | 13 +++ ...ncGenerators.objectLiteralMethod.14.es5.js | 68 +++++++++++++++ ...erators.objectLiteralMethod.14.es5.symbols | 15 ++++ ...enerators.objectLiteralMethod.14.es5.types | 17 ++++ ...ncGenerators.objectLiteralMethod.15.es5.js | 61 +++++++++++++ ...erators.objectLiteralMethod.15.es5.symbols | 10 +++ ...enerators.objectLiteralMethod.15.es5.types | 13 +++ ...tors.objectLiteralMethod.16.es5.errors.txt | 11 +++ ...ncGenerators.objectLiteralMethod.16.es5.js | 61 +++++++++++++ ...tors.objectLiteralMethod.17.es5.errors.txt | 11 +++ ...ncGenerators.objectLiteralMethod.17.es5.js | 57 ++++++++++++ ...tors.objectLiteralMethod.18.es5.errors.txt | 11 +++ ...ncGenerators.objectLiteralMethod.18.es5.js | 57 ++++++++++++ ...ncGenerators.objectLiteralMethod.19.es5.js | 64 ++++++++++++++ ...erators.objectLiteralMethod.19.es5.symbols | 11 +++ ...enerators.objectLiteralMethod.19.es5.types | 15 ++++ ...yncGenerators.objectLiteralMethod.2.es5.js | 50 +++++++++++ ...nerators.objectLiteralMethod.2.es5.symbols | 7 ++ ...Generators.objectLiteralMethod.2.es5.types | 8 ++ ...tors.objectLiteralMethod.20.es5.errors.txt | 11 +++ ...ncGenerators.objectLiteralMethod.20.es5.js | 57 ++++++++++++ ...tors.objectLiteralMethod.21.es5.errors.txt | 10 +++ ...ncGenerators.objectLiteralMethod.21.es5.js | 56 ++++++++++++ ...tors.objectLiteralMethod.22.es5.errors.txt | 10 +++ ...ncGenerators.objectLiteralMethod.22.es5.js | 56 ++++++++++++ ...yncGenerators.objectLiteralMethod.3.es5.js | 50 +++++++++++ ...nerators.objectLiteralMethod.3.es5.symbols | 7 ++ ...Generators.objectLiteralMethod.3.es5.types | 8 ++ ...ators.objectLiteralMethod.4.es5.errors.txt | 18 ++++ ...yncGenerators.objectLiteralMethod.4.es5.js | 50 +++++++++++ ...ators.objectLiteralMethod.5.es5.errors.txt | 18 ++++ ...yncGenerators.objectLiteralMethod.5.es5.js | 50 +++++++++++ ...ators.objectLiteralMethod.6.es5.errors.txt | 9 ++ ...yncGenerators.objectLiteralMethod.6.es5.js | 53 ++++++++++++ ...ators.objectLiteralMethod.7.es5.errors.txt | 9 ++ ...yncGenerators.objectLiteralMethod.7.es5.js | 53 ++++++++++++ ...yncGenerators.objectLiteralMethod.8.es5.js | 64 ++++++++++++++ ...nerators.objectLiteralMethod.8.es5.symbols | 12 +++ ...Generators.objectLiteralMethod.8.es5.types | 13 +++ ...ators.objectLiteralMethod.9.es5.errors.txt | 15 ++++ ...yncGenerators.objectLiteralMethod.9.es5.js | 66 ++++++++++++++ .../reference/forAwait.1.es5.errors.txt | 9 ++ tests/baselines/reference/forAwait.1.es5.js | 19 ++++ .../reference/forAwait.2.es5.errors.txt | 11 +++ tests/baselines/reference/forAwait.2.es5.js | 23 +++++ tests/baselines/reference/forAwait.3.es5.js | 82 ++++++++++++++++++ .../reference/forAwait.3.es5.symbols | 13 +++ .../baselines/reference/forAwait.3.es5.types | 13 +++ tests/baselines/reference/forAwait.4.es5.js | 82 ++++++++++++++++++ .../reference/forAwait.4.es5.symbols | 13 +++ .../baselines/reference/forAwait.4.es5.types | 13 +++ tests/baselines/reference/forAwait.5.es5.js | 86 +++++++++++++++++++ .../reference/forAwait.5.es5.symbols | 13 +++ .../baselines/reference/forAwait.5.es5.types | 13 +++ tests/baselines/reference/forAwait.6.es5.js | 86 +++++++++++++++++++ .../reference/forAwait.6.es5.symbols | 13 +++ .../baselines/reference/forAwait.6.es5.types | 13 +++ .../reference/forAwait.7.es5.errors.txt | 11 +++ tests/baselines/reference/forAwait.7.es5.js | 72 ++++++++++++++++ .../reference/forAwait.8.es5.errors.txt | 11 +++ tests/baselines/reference/forAwait.8.es5.js | 72 ++++++++++++++++ .../asyncGenerators.classMethod.1.es5.ts | 5 ++ .../asyncGenerators.classMethod.10.es5.ts | 8 ++ .../asyncGenerators.classMethod.11.es5.ts | 7 ++ .../asyncGenerators.classMethod.12.es5.ts | 7 ++ .../asyncGenerators.classMethod.13.es5.ts | 7 ++ .../asyncGenerators.classMethod.14.es5.ts | 8 ++ .../asyncGenerators.classMethod.15.es5.ts | 7 ++ .../asyncGenerators.classMethod.16.es5.ts | 7 ++ .../asyncGenerators.classMethod.17.es5.ts | 7 ++ .../asyncGenerators.classMethod.18.es5.ts | 7 ++ .../asyncGenerators.classMethod.19.es5.ts | 7 ++ .../asyncGenerators.classMethod.2.es5.ts | 5 ++ .../asyncGenerators.classMethod.20.es5.ts | 7 ++ .../asyncGenerators.classMethod.21.es5.ts | 6 ++ .../asyncGenerators.classMethod.22.es5.ts | 6 ++ .../asyncGenerators.classMethod.3.es5.ts | 5 ++ .../asyncGenerators.classMethod.4.es5.ts | 5 ++ .../asyncGenerators.classMethod.5.es5.ts | 5 ++ .../asyncGenerators.classMethod.6.es5.ts | 5 ++ .../asyncGenerators.classMethod.7.es5.ts | 5 ++ .../asyncGenerators.classMethod.8.es5.ts | 8 ++ .../asyncGenerators.classMethod.9.es5.ts | 8 ++ ...yncGenerators.functionDeclaration.1.es5.ts | 3 + ...ncGenerators.functionDeclaration.10.es5.ts | 6 ++ ...ncGenerators.functionDeclaration.11.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.12.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.13.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.14.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.15.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.16.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.17.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.18.es5.ts | 5 ++ ...ncGenerators.functionDeclaration.19.es5.ts | 5 ++ ...yncGenerators.functionDeclaration.2.es5.ts | 3 + ...ncGenerators.functionDeclaration.20.es5.ts | 5 ++ ...yncGenerators.functionDeclaration.3.es5.ts | 3 + ...yncGenerators.functionDeclaration.4.es5.ts | 3 + ...yncGenerators.functionDeclaration.5.es5.ts | 3 + ...yncGenerators.functionDeclaration.6.es5.ts | 3 + ...yncGenerators.functionDeclaration.7.es5.ts | 3 + ...yncGenerators.functionDeclaration.8.es5.ts | 6 ++ ...yncGenerators.functionDeclaration.9.es5.ts | 6 ++ ...syncGenerators.functionExpression.1.es5.ts | 3 + ...yncGenerators.functionExpression.10.es5.ts | 6 ++ ...yncGenerators.functionExpression.11.es5.ts | 5 ++ ...yncGenerators.functionExpression.12.es5.ts | 5 ++ ...yncGenerators.functionExpression.13.es5.ts | 5 ++ ...yncGenerators.functionExpression.14.es5.ts | 5 ++ ...yncGenerators.functionExpression.15.es5.ts | 5 ++ ...yncGenerators.functionExpression.16.es5.ts | 5 ++ ...yncGenerators.functionExpression.17.es5.ts | 5 ++ ...yncGenerators.functionExpression.18.es5.ts | 5 ++ ...yncGenerators.functionExpression.19.es5.ts | 5 ++ ...syncGenerators.functionExpression.2.es5.ts | 3 + ...syncGenerators.functionExpression.3.es5.ts | 3 + ...syncGenerators.functionExpression.4.es5.ts | 3 + ...syncGenerators.functionExpression.5.es5.ts | 3 + ...syncGenerators.functionExpression.6.es5.ts | 3 + ...syncGenerators.functionExpression.7.es5.ts | 3 + ...syncGenerators.functionExpression.8.es5.ts | 6 ++ ...syncGenerators.functionExpression.9.es5.ts | 6 ++ ...yncGenerators.objectLiteralMethod.1.es5.ts | 5 ++ ...ncGenerators.objectLiteralMethod.10.es5.ts | 8 ++ ...ncGenerators.objectLiteralMethod.11.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.12.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.13.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.14.es5.ts | 8 ++ ...ncGenerators.objectLiteralMethod.15.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.16.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.17.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.18.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.19.es5.ts | 7 ++ ...yncGenerators.objectLiteralMethod.2.es5.ts | 5 ++ ...ncGenerators.objectLiteralMethod.20.es5.ts | 7 ++ ...ncGenerators.objectLiteralMethod.21.es5.ts | 6 ++ ...ncGenerators.objectLiteralMethod.22.es5.ts | 6 ++ ...yncGenerators.objectLiteralMethod.3.es5.ts | 5 ++ ...yncGenerators.objectLiteralMethod.4.es5.ts | 5 ++ ...yncGenerators.objectLiteralMethod.5.es5.ts | 5 ++ ...yncGenerators.objectLiteralMethod.6.es5.ts | 5 ++ ...yncGenerators.objectLiteralMethod.7.es5.ts | 5 ++ ...yncGenerators.objectLiteralMethod.8.es5.ts | 8 ++ ...yncGenerators.objectLiteralMethod.9.es5.ts | 8 ++ .../forAwait/es5/forAwait.1.es5.ts | 5 ++ .../forAwait/es5/forAwait.2.es5.ts | 7 ++ .../forAwait/es5/forAwait.3.es5.ts | 7 ++ .../forAwait/es5/forAwait.4.es5.ts | 7 ++ .../forAwait/es5/forAwait.5.es5.ts | 7 ++ .../forAwait/es5/forAwait.6.es5.ts | 7 ++ .../forAwait/es5/forAwait.7.es5.ts | 7 ++ .../forAwait/es5/forAwait.8.es5.ts | 7 ++ 317 files changed, 7137 insertions(+) create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.1.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.1.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.1.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.10.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.10.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.11.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.11.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.11.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.12.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.12.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.12.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.13.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.13.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.13.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.14.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.14.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.14.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.15.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.15.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.15.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.16.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.16.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.17.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.17.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.18.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.18.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.19.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.19.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.19.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.2.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.2.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.2.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.20.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.20.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.21.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.21.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.22.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.22.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.3.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.3.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.3.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.4.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.4.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.5.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.5.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.6.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.6.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.7.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.7.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.8.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.8.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.8.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.9.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.classMethod.9.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.1.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.1.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.1.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.10.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.10.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.11.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.11.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.11.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.12.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.12.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.12.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.13.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.13.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.13.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.14.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.14.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.14.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.15.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.15.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.15.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.16.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.16.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.17.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.17.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.18.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.18.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.19.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.19.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.19.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.2.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.2.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.2.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.3.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.3.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.3.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.4.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.4.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.5.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.5.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.6.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.6.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.7.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.7.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.8.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.8.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.8.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.9.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.functionExpression.9.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.js create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.symbols create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.types create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.errors.txt create mode 100644 tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.js create mode 100644 tests/baselines/reference/forAwait.1.es5.errors.txt create mode 100644 tests/baselines/reference/forAwait.1.es5.js create mode 100644 tests/baselines/reference/forAwait.2.es5.errors.txt create mode 100644 tests/baselines/reference/forAwait.2.es5.js create mode 100644 tests/baselines/reference/forAwait.3.es5.js create mode 100644 tests/baselines/reference/forAwait.3.es5.symbols create mode 100644 tests/baselines/reference/forAwait.3.es5.types create mode 100644 tests/baselines/reference/forAwait.4.es5.js create mode 100644 tests/baselines/reference/forAwait.4.es5.symbols create mode 100644 tests/baselines/reference/forAwait.4.es5.types create mode 100644 tests/baselines/reference/forAwait.5.es5.js create mode 100644 tests/baselines/reference/forAwait.5.es5.symbols create mode 100644 tests/baselines/reference/forAwait.5.es5.types create mode 100644 tests/baselines/reference/forAwait.6.es5.js create mode 100644 tests/baselines/reference/forAwait.6.es5.symbols create mode 100644 tests/baselines/reference/forAwait.6.es5.types create mode 100644 tests/baselines/reference/forAwait.7.es5.errors.txt create mode 100644 tests/baselines/reference/forAwait.7.es5.js create mode 100644 tests/baselines/reference/forAwait.8.es5.errors.txt create mode 100644 tests/baselines/reference/forAwait.8.es5.js create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts create mode 100644 tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts create mode 100644 tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts diff --git a/tests/baselines/reference/asyncGenerators.classMethod.1.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.js new file mode 100644 index 00000000000..b81b644bcdc --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.js @@ -0,0 +1,54 @@ +//// [asyncGenerators.classMethod.1.es5.ts] +class C { + async * f() {} +} + + +//// [asyncGenerators.classMethod.1.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.1.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.symbols new file mode 100644 index 00000000000..7130557ae2a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.1.es5.ts, 0, 0)) + + async * f() {} +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.1.es5.ts, 0, 9)) +} + diff --git a/tests/baselines/reference/asyncGenerators.classMethod.1.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.types new file mode 100644 index 00000000000..f55117e6916 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.1.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts === +class C { +>C : C + + async * f() {} +>f : () => AsyncIterableIterator +} + diff --git a/tests/baselines/reference/asyncGenerators.classMethod.10.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.10.es5.errors.txt new file mode 100644 index 00000000000..affb0cde6d4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.10.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts(3,26): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts(3,32): error TS1109: Expression expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts(3,34): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts (3 errors) ==== + class C { + async * f() { + async function * await() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.10.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.10.es5.js new file mode 100644 index 00000000000..91aac09e55a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.10.es5.js @@ -0,0 +1,70 @@ +//// [asyncGenerators.classMethod.10.es5.ts] +class C { + async * f() { + async function * await() { + } + } +} + +//// [asyncGenerators.classMethod.10.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ()]]; + case 1: + _a.sent(); + { + } + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.11.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.js new file mode 100644 index 00000000000..4538ca277c3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.classMethod.11.es5.ts] +class C { + async * f() { + yield; + } +} + +//// [asyncGenerators.classMethod.11.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield"]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.11.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.symbols new file mode 100644 index 00000000000..933f9895629 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.11.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.11.es5.ts, 0, 9)) + + yield; + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.11.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.types new file mode 100644 index 00000000000..cc7441087c3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.11.es5.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + yield; +>yield : any + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.12.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.js new file mode 100644 index 00000000000..0918e636a0a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.classMethod.12.es5.ts] +class C { + async * f() { + yield 1; + } +} + +//// [asyncGenerators.classMethod.12.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.12.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.symbols new file mode 100644 index 00000000000..29f6b5bc7db --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.12.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.12.es5.ts, 0, 9)) + + yield 1; + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.12.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.types new file mode 100644 index 00000000000..88e32d06437 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.12.es5.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator<1> + + yield 1; +>yield 1 : any +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.13.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.js new file mode 100644 index 00000000000..d744675fba3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.js @@ -0,0 +1,70 @@ +//// [asyncGenerators.classMethod.13.es5.ts] +class C { + async * f() { + yield * []; + } +} + +//// [asyncGenerators.classMethod.13.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator([], "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.13.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.symbols new file mode 100644 index 00000000000..f7d2c8854b3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.13.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.13.es5.ts, 0, 9)) + + yield * []; + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.13.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.types new file mode 100644 index 00000000000..5bab3745ba8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.13.es5.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + yield * []; +>yield * [] : any +>[] : undefined[] + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.14.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.js new file mode 100644 index 00000000000..5756166d9fa --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.js @@ -0,0 +1,71 @@ +//// [asyncGenerators.classMethod.14.es5.ts] +declare const ai: AsyncIterable; +class C { + async * f() { + yield * ai; + } +} + +//// [asyncGenerators.classMethod.14.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator(ai, "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.14.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.symbols new file mode 100644 index 00000000000..c556c21e780 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts === +declare const ai: AsyncIterable; +>ai : Symbol(ai, Decl(asyncGenerators.classMethod.14.es5.ts, 0, 13)) +>AsyncIterable : Symbol(AsyncIterable, Decl(lib.es2017.asynciterable.d.ts, --, --)) + +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.14.es5.ts, 0, 40)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.14.es5.ts, 1, 9)) + + yield * ai; +>ai : Symbol(ai, Decl(asyncGenerators.classMethod.14.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.14.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.types new file mode 100644 index 00000000000..7f17a6dce18 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.14.es5.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts === +declare const ai: AsyncIterable; +>ai : AsyncIterable +>AsyncIterable : AsyncIterable + +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + yield * ai; +>yield * ai : any +>ai : AsyncIterable + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.15.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.js new file mode 100644 index 00000000000..45a4bcb3e3a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.classMethod.15.es5.ts] +class C { + async * f() { + await 1; + } +} + +//// [asyncGenerators.classMethod.15.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.15.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.symbols new file mode 100644 index 00000000000..79b695bbb40 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.15.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.15.es5.ts, 0, 9)) + + await 1; + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.15.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.types new file mode 100644 index 00000000000..a2abf16064b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.15.es5.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + await 1; +>await 1 : 1 +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.16.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.16.es5.errors.txt new file mode 100644 index 00000000000..bab85a07316 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.16.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts(3,14): error TS1109: Expression expected. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts (1 errors) ==== + class C { + async * f() { + await; + ~ +!!! error TS1109: Expression expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.16.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.16.es5.js new file mode 100644 index 00000000000..19a0d4b7803 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.16.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.classMethod.16.es5.ts] +class C { + async * f() { + await; + } +} + +//// [asyncGenerators.classMethod.16.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.17.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.17.es5.errors.txt new file mode 100644 index 00000000000..a7f84d9e5c6 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.17.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts(3,16): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts (1 errors) ==== + class C { + async * f() { + var x: await; + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.17.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.17.es5.js new file mode 100644 index 00000000000..c41ced48301 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.17.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.classMethod.17.es5.ts] +class C { + async * f() { + var x: await; + } +} + +//// [asyncGenerators.classMethod.17.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.18.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.18.es5.errors.txt new file mode 100644 index 00000000000..00b4f4b21e7 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.18.es5.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts(3,16): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts(3,16): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts (2 errors) ==== + class C { + async * f() { + var x: yield; + ~~~~~ +!!! error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.18.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.18.es5.js new file mode 100644 index 00000000000..8c46943ad83 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.18.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.classMethod.18.es5.ts] +class C { + async * f() { + var x: yield; + } +} + +//// [asyncGenerators.classMethod.18.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.19.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.js new file mode 100644 index 00000000000..df6d51956ba --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.js @@ -0,0 +1,67 @@ +//// [asyncGenerators.classMethod.19.es5.ts] +class C { + async * f() { + var x = { [yield]: 1 }; + } +} + +//// [asyncGenerators.classMethod.19.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + var x, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = {}; + return [4 /*yield*/, ["yield"]]; + case 1: + x = (_a[_b.sent()] = 1, _a); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.19.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.symbols new file mode 100644 index 00000000000..7c980f672a9 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.19.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.19.es5.ts, 0, 9)) + + var x = { [yield]: 1 }; +>x : Symbol(x, Decl(asyncGenerators.classMethod.19.es5.ts, 2, 11)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.19.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.types new file mode 100644 index 00000000000..8b8c32bece8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.19.es5.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + var x = { [yield]: 1 }; +>x : { [x: number]: number; } +>{ [yield]: 1 } : { [x: number]: number; } +>yield : any +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.2.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.js new file mode 100644 index 00000000000..c3fc06a1dc4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.classMethod.2.es5.ts] +class C { + async * await() {} +} + +//// [asyncGenerators.classMethod.2.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.await = function () { return __asyncGenerator(this, arguments, function await_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.2.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.symbols new file mode 100644 index 00000000000..0c2b26f2580 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.2.es5.ts, 0, 0)) + + async * await() {} +>await : Symbol(C.await, Decl(asyncGenerators.classMethod.2.es5.ts, 0, 9)) +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.2.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.types new file mode 100644 index 00000000000..75949b9bb5f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.2.es5.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts === +class C { +>C : C + + async * await() {} +>await : () => AsyncIterableIterator +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.20.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.20.es5.errors.txt new file mode 100644 index 00000000000..5c8ffa865f8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.20.es5.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts(3,16): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts(3,16): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts (2 errors) ==== + class C { + async * f() { + var x: yield; + ~~~~~ +!!! error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.20.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.20.es5.js new file mode 100644 index 00000000000..14f0d6b27ae --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.20.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.classMethod.20.es5.ts] +class C { + async * f() { + var x: yield; + } +} + +//// [asyncGenerators.classMethod.20.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.21.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.21.es5.errors.txt new file mode 100644 index 00000000000..f8e6dd05bcd --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.21.es5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts(2,14): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts(2,14): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts (2 errors) ==== + class C { + async * [yield]() { + ~~~~~ +!!! error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.21.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.21.es5.js new file mode 100644 index 00000000000..7b1666e3d88 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.21.es5.js @@ -0,0 +1,58 @@ +//// [asyncGenerators.classMethod.21.es5.ts] +class C { + async * [yield]() { + } +} + +//// [asyncGenerators.classMethod.21.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype[yield] = function () { + return __asyncGenerator(this, arguments, function _a() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.22.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.22.es5.errors.txt new file mode 100644 index 00000000000..0a6d34323cd --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.22.es5.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts(2,14): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts (1 errors) ==== + class C { + async * [await]() { + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.22.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.22.es5.js new file mode 100644 index 00000000000..161cee2ee12 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.22.es5.js @@ -0,0 +1,58 @@ +//// [asyncGenerators.classMethod.22.es5.ts] +class C { + async * [await]() { + } +} + +//// [asyncGenerators.classMethod.22.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype[await] = function () { + return __asyncGenerator(this, arguments, function _a() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.3.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.js new file mode 100644 index 00000000000..a68c0846bba --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.classMethod.3.es5.ts] +class C { + async * yield() {} +} + +//// [asyncGenerators.classMethod.3.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.yield = function () { return __asyncGenerator(this, arguments, function yield_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.3.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.symbols new file mode 100644 index 00000000000..1e23134637c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.3.es5.ts, 0, 0)) + + async * yield() {} +>yield : Symbol(C.yield, Decl(asyncGenerators.classMethod.3.es5.ts, 0, 9)) +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.3.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.types new file mode 100644 index 00000000000..0bd30695bd2 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.3.es5.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts === +class C { +>C : C + + async * yield() {} +>yield : () => AsyncIterableIterator +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.4.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.4.es5.errors.txt new file mode 100644 index 00000000000..5268826e989 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.4.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts(2,15): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts(2,15): error TS2304: Cannot find name 'await'. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts(2,20): error TS1005: ';' expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts (4 errors) ==== + class C { + async * f(await) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + ~ +!!! error TS1005: ';' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.4.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.4.es5.js new file mode 100644 index 00000000000..1006fb176f3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.4.es5.js @@ -0,0 +1,55 @@ +//// [asyncGenerators.classMethod.4.es5.ts] +class C { + async * f(await) {} +} + +//// [asyncGenerators.classMethod.4.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return C; +}()); +await; +{ } diff --git a/tests/baselines/reference/asyncGenerators.classMethod.5.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.5.es5.errors.txt new file mode 100644 index 00000000000..c18464d936d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.5.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts(2,15): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts(2,15): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts(2,20): error TS1005: ';' expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts (4 errors) ==== + class C { + async * f(yield) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + ~ +!!! error TS1005: ';' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.5.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.5.es5.js new file mode 100644 index 00000000000..2f72748cb51 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.5.es5.js @@ -0,0 +1,55 @@ +//// [asyncGenerators.classMethod.5.es5.ts] +class C { + async * f(yield) {} +} + +//// [asyncGenerators.classMethod.5.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }; + return C; +}()); +yield; +{ } diff --git a/tests/baselines/reference/asyncGenerators.classMethod.6.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.6.es5.errors.txt new file mode 100644 index 00000000000..9b725391a5b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.6.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts(2,19): error TS2524: 'await' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts (1 errors) ==== + class C { + async * f(a = await 1) {} + ~~~~~~~ +!!! error TS2524: 'await' expressions cannot be used in a parameter initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.6.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.6.es5.js new file mode 100644 index 00000000000..cf2248b7696 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.6.es5.js @@ -0,0 +1,56 @@ +//// [asyncGenerators.classMethod.6.es5.ts] +class C { + async * f(a = await 1) {} +} + +//// [asyncGenerators.classMethod.6.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function (a) { + if (a === void 0) { a = yield ["await", 1]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.7.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.7.es5.errors.txt new file mode 100644 index 00000000000..86693e75ea4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.7.es5.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts(2,19): error TS1163: A 'yield' expression is only allowed in a generator body. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts(2,19): error TS2523: 'yield' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts (2 errors) ==== + class C { + async * f(a = yield) {} + ~~~~~ +!!! error TS1163: A 'yield' expression is only allowed in a generator body. + ~~~~~ +!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.7.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.7.es5.js new file mode 100644 index 00000000000..f13718eda6e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.7.es5.js @@ -0,0 +1,56 @@ +//// [asyncGenerators.classMethod.7.es5.ts] +class C { + async * f(a = yield) {} +} + +//// [asyncGenerators.classMethod.7.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function (a) { + if (a === void 0) { a = yield ["yield"]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.8.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.js new file mode 100644 index 00000000000..cfb4b8f8423 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.js @@ -0,0 +1,67 @@ +//// [asyncGenerators.classMethod.8.es5.ts] +class C { + async * f() { + async function * g() { + } + } +} + +//// [asyncGenerators.classMethod.8.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + function g() { + return __asyncGenerator(this, arguments, function g_1() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.classMethod.8.es5.symbols b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.symbols new file mode 100644 index 00000000000..51885036757 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts === +class C { +>C : Symbol(C, Decl(asyncGenerators.classMethod.8.es5.ts, 0, 0)) + + async * f() { +>f : Symbol(C.f, Decl(asyncGenerators.classMethod.8.es5.ts, 0, 9)) + + async function * g() { +>g : Symbol(g, Decl(asyncGenerators.classMethod.8.es5.ts, 1, 17)) + } + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.8.es5.types b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.types new file mode 100644 index 00000000000..2121f117234 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.8.es5.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts === +class C { +>C : C + + async * f() { +>f : () => AsyncIterableIterator + + async function * g() { +>g : () => AsyncIterableIterator + } + } +} diff --git a/tests/baselines/reference/asyncGenerators.classMethod.9.es5.errors.txt b/tests/baselines/reference/asyncGenerators.classMethod.9.es5.errors.txt new file mode 100644 index 00000000000..cf7d51c62eb --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.9.es5.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts(3,26): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts(3,34): error TS1005: '=>' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts (2 errors) ==== + class C { + async * f() { + async function * yield() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: '=>' expected. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.classMethod.9.es5.js b/tests/baselines/reference/asyncGenerators.classMethod.9.es5.js new file mode 100644 index 00000000000..d68d5bf2e38 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.classMethod.9.es5.js @@ -0,0 +1,69 @@ +//// [asyncGenerators.classMethod.9.es5.ts] +class C { + async * f() { + async function * yield() { + } + } +} + +//// [asyncGenerators.classMethod.9.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var C = (function () { + function C() { + } + C.prototype.f = function () { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", function () { + }]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return C; +}()); diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.js new file mode 100644 index 00000000000..0768bd4816e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionDeclaration.1.es5.ts] +async function * f() {} + +//// [asyncGenerators.functionDeclaration.1.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); } diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.symbols new file mode 100644 index 00000000000..34867927775 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts === +async function * f() {} +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.1.es5.ts, 0, 0)) + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.types new file mode 100644 index 00000000000..7aac8362e42 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.1.es5.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts === +async function * f() {} +>f : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.errors.txt new file mode 100644 index 00000000000..995102b3527 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts(2,22): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts(2,28): error TS1109: Expression expected. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts(2,30): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts (3 errors) ==== + async function * f() { + async function * await() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.js new file mode 100644 index 00000000000..13d0449fb86 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.10.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionDeclaration.10.es5.ts] +async function * f() { + async function * await() { + } +} + +//// [asyncGenerators.functionDeclaration.10.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ()]]; + case 1: + _a.sent(); + { + } + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.js new file mode 100644 index 00000000000..9d7a8af4dcb --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionDeclaration.11.es5.ts] +async function * f() { + yield; +} + +//// [asyncGenerators.functionDeclaration.11.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield"]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.symbols new file mode 100644 index 00000000000..cbacf32df2f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.11.es5.ts, 0, 0)) + + yield; +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.types new file mode 100644 index 00000000000..63fdecc0ec8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.11.es5.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator + + yield; +>yield : any +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.js new file mode 100644 index 00000000000..834bcbee76c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionDeclaration.12.es5.ts] +async function * f() { + yield 1; +} + +//// [asyncGenerators.functionDeclaration.12.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.symbols new file mode 100644 index 00000000000..2770ef0b951 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.12.es5.ts, 0, 0)) + + yield 1; +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.types new file mode 100644 index 00000000000..60ddcc5d93a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.12.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator<1> + + yield 1; +>yield 1 : any +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.js new file mode 100644 index 00000000000..aa683525170 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionDeclaration.13.es5.ts] +async function * f() { + yield * []; +} + +//// [asyncGenerators.functionDeclaration.13.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator([], "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.symbols new file mode 100644 index 00000000000..3b76007bf32 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.13.es5.ts, 0, 0)) + + yield * []; +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.types new file mode 100644 index 00000000000..8cc2cc47748 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.13.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator + + yield * []; +>yield * [] : any +>[] : undefined[] +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.js new file mode 100644 index 00000000000..20920c1841e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionDeclaration.14.es5.ts] +async function * f() { + yield * f(); +} + +//// [asyncGenerators.functionDeclaration.14.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator(f(), "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.symbols new file mode 100644 index 00000000000..7d363bd4621 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.14.es5.ts, 0, 0)) + + yield * f(); +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.14.es5.ts, 0, 0)) +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.types new file mode 100644 index 00000000000..fd228d31f23 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.14.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts === +async function * f() { +>f : () => any + + yield * f(); +>yield * f() : any +>f() : any +>f : () => any +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.js new file mode 100644 index 00000000000..ac4db813631 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionDeclaration.15.es5.ts] +async function * f() { + await 1; +} + +//// [asyncGenerators.functionDeclaration.15.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.symbols new file mode 100644 index 00000000000..86f724a10fe --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.15.es5.ts, 0, 0)) + + await 1; +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.types new file mode 100644 index 00000000000..c61b20e971a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.15.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator + + await 1; +>await 1 : 1 +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.errors.txt new file mode 100644 index 00000000000..5066fdc656b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts(2,10): error TS1109: Expression expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts (1 errors) ==== + async function * f() { + await; + ~ +!!! error TS1109: Expression expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.js new file mode 100644 index 00000000000..b1e7d1121b8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.16.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionDeclaration.16.es5.ts] +async function * f() { + await; +} + +//// [asyncGenerators.functionDeclaration.16.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.errors.txt new file mode 100644 index 00000000000..b233821cf07 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts(2,12): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts (1 errors) ==== + async function * f() { + var x: await; + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.js new file mode 100644 index 00000000000..455403ff423 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.17.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.functionDeclaration.17.es5.ts] +async function * f() { + var x: await; +} + +//// [asyncGenerators.functionDeclaration.17.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.errors.txt new file mode 100644 index 00000000000..1711e2d27fe --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts(2,12): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts (1 errors) ==== + async function * f() { + var x: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.js new file mode 100644 index 00000000000..dbcfb3f6cbf --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.18.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.functionDeclaration.18.es5.ts] +async function * f() { + var x: yield; +} + +//// [asyncGenerators.functionDeclaration.18.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.js new file mode 100644 index 00000000000..b839a9ce3a9 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.functionDeclaration.19.es5.ts] +async function * f() { + var x = { [yield]: 1 }; +} + +//// [asyncGenerators.functionDeclaration.19.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var x, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = {}; + return [4 /*yield*/, ["yield"]]; + case 1: + x = (_a[_b.sent()] = 1, _a); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.symbols new file mode 100644 index 00000000000..2a7e8bfe441 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.19.es5.ts, 0, 0)) + + var x = { [yield]: 1 }; +>x : Symbol(x, Decl(asyncGenerators.functionDeclaration.19.es5.ts, 1, 7)) +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.types new file mode 100644 index 00000000000..0ef0f410eb3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.19.es5.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator + + var x = { [yield]: 1 }; +>x : { [x: number]: number; } +>{ [yield]: 1 } : { [x: number]: number; } +>yield : any +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.js new file mode 100644 index 00000000000..a967b37a0f4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionDeclaration.2.es5.ts] +async function * await() {} + +//// [asyncGenerators.functionDeclaration.2.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function await() { return __asyncGenerator(this, arguments, function await_1() { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); } diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.symbols new file mode 100644 index 00000000000..a33f2a674af --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts === +async function * await() {} +>await : Symbol(await, Decl(asyncGenerators.functionDeclaration.2.es5.ts, 0, 0)) + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.types new file mode 100644 index 00000000000..4e37a7ebb94 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.2.es5.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts === +async function * await() {} +>await : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.errors.txt new file mode 100644 index 00000000000..0a92d9a146b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts(2,12): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts (1 errors) ==== + async function * f() { + var x: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.js new file mode 100644 index 00000000000..62b0d45601f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.20.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.functionDeclaration.20.es5.ts] +async function * f() { + var x: yield; +} + +//// [asyncGenerators.functionDeclaration.20.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.js new file mode 100644 index 00000000000..f8d4c61ca1a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionDeclaration.3.es5.ts] +async function * yield() {} + +//// [asyncGenerators.functionDeclaration.3.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function yield() { return __asyncGenerator(this, arguments, function yield_1() { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); } diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.symbols new file mode 100644 index 00000000000..db9ec5d2635 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts === +async function * yield() {} +>yield : Symbol(yield, Decl(asyncGenerators.functionDeclaration.3.es5.ts, 0, 0)) + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.types new file mode 100644 index 00000000000..91712ae5d2a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.3.es5.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts === +async function * yield() {} +>yield : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.errors.txt new file mode 100644 index 00000000000..ca01ebf844d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts(1,20): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts(1,20): error TS2304: Cannot find name 'await'. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts(1,25): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts (3 errors) ==== + async function * f(await) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.js new file mode 100644 index 00000000000..ac4c6c7cdad --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.4.es5.js @@ -0,0 +1,48 @@ +//// [asyncGenerators.functionDeclaration.4.es5.ts] +async function * f(await) {} + +//// [asyncGenerators.functionDeclaration.4.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); } +await; +{ } diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.errors.txt new file mode 100644 index 00000000000..60fde2bfd8c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts(1,20): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts(1,20): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts(1,25): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts (3 errors) ==== + async function * f(yield) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.js new file mode 100644 index 00000000000..a2fc8dd61e2 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.5.es5.js @@ -0,0 +1,48 @@ +//// [asyncGenerators.functionDeclaration.5.es5.ts] +async function * f(yield) {} + +//// [asyncGenerators.functionDeclaration.5.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); } +yield; +{ } diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.errors.txt new file mode 100644 index 00000000000..cc0e080b4b6 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts(1,24): error TS2524: 'await' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts (1 errors) ==== + async function * f(a = await 1) {} + ~~~~~~~ +!!! error TS2524: 'await' expressions cannot be used in a parameter initializer. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.js new file mode 100644 index 00000000000..236b9801205 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.6.es5.js @@ -0,0 +1,49 @@ +//// [asyncGenerators.functionDeclaration.6.es5.ts] +async function * f(a = await 1) {} + +//// [asyncGenerators.functionDeclaration.6.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f(a) { + if (a === void 0) { a = yield ["await", 1]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.errors.txt new file mode 100644 index 00000000000..48f03414d04 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts(1,24): error TS2523: 'yield' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts (1 errors) ==== + async function * f(a = yield) {} + ~~~~~ +!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.js new file mode 100644 index 00000000000..0701da84232 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.7.es5.js @@ -0,0 +1,49 @@ +//// [asyncGenerators.functionDeclaration.7.es5.ts] +async function * f(a = yield) {} + +//// [asyncGenerators.functionDeclaration.7.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f(a) { + if (a === void 0) { a = yield ["yield"]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.js new file mode 100644 index 00000000000..c3f9b302c9b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.functionDeclaration.8.es5.ts] +async function * f() { + async function * g() { + } +} + +//// [asyncGenerators.functionDeclaration.8.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + function g() { + return __asyncGenerator(this, arguments, function g_1() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.symbols b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.symbols new file mode 100644 index 00000000000..3679bfebf63 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts === +async function * f() { +>f : Symbol(f, Decl(asyncGenerators.functionDeclaration.8.es5.ts, 0, 0)) + + async function * g() { +>g : Symbol(g, Decl(asyncGenerators.functionDeclaration.8.es5.ts, 0, 22)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.types b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.types new file mode 100644 index 00000000000..aaaa67e170d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.8.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts === +async function * f() { +>f : () => AsyncIterableIterator + + async function * g() { +>g : () => AsyncIterableIterator + } +} diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.errors.txt new file mode 100644 index 00000000000..813aa767151 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts(2,22): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts(2,30): error TS1005: '=>' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts (2 errors) ==== + async function * f() { + async function * yield() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: '=>' expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.js b/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.js new file mode 100644 index 00000000000..fea3951ed5d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionDeclaration.9.es5.js @@ -0,0 +1,62 @@ +//// [asyncGenerators.functionDeclaration.9.es5.ts] +async function * f() { + async function * yield() { + } +} + +//// [asyncGenerators.functionDeclaration.9.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", function () { + }]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.js new file mode 100644 index 00000000000..a31f124debb --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionExpression.1.es5.ts] +const f = async function * () {} + +//// [asyncGenerators.functionExpression.1.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); }; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.symbols new file mode 100644 index 00000000000..8f670a84462 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts === +const f = async function * () {} +>f : Symbol(f, Decl(asyncGenerators.functionExpression.1.es5.ts, 0, 5)) + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.types new file mode 100644 index 00000000000..d1127af4627 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.1.es5.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts === +const f = async function * () {} +>f : () => AsyncIterableIterator +>async function * () {} : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.errors.txt new file mode 100644 index 00000000000..7982814e47b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts(2,22): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts(2,28): error TS1109: Expression expected. +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts(2,30): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts (3 errors) ==== + const f = async function * () { + async function * await() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.js new file mode 100644 index 00000000000..d3f5b09c0ec --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.10.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionExpression.10.es5.ts] +const f = async function * () { + async function * await() { + } +} + +//// [asyncGenerators.functionExpression.10.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ()]]; + case 1: + _a.sent(); + { + } + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.js new file mode 100644 index 00000000000..40e96addb07 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionExpression.11.es5.ts] +const f = async function * () { + yield; +} + +//// [asyncGenerators.functionExpression.11.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield"]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.symbols new file mode 100644 index 00000000000..8ae34fd4476 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.11.es5.ts, 0, 5)) + + yield; +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.types new file mode 100644 index 00000000000..4906b7e976d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.11.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts === +const f = async function * () { +>f : () => AsyncIterableIterator +>async function * () { yield;} : () => AsyncIterableIterator + + yield; +>yield : any +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.js new file mode 100644 index 00000000000..19403f483ea --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionExpression.12.es5.ts] +const f = async function * () { + yield 1; +} + +//// [asyncGenerators.functionExpression.12.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.symbols new file mode 100644 index 00000000000..b0ee8bb68b9 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.12.es5.ts, 0, 5)) + + yield 1; +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.types new file mode 100644 index 00000000000..c7baf404d60 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.12.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts === +const f = async function * () { +>f : () => AsyncIterableIterator<1> +>async function * () { yield 1;} : () => AsyncIterableIterator<1> + + yield 1; +>yield 1 : any +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.js new file mode 100644 index 00000000000..de3f33d3f7d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionExpression.13.es5.ts] +const f = async function * () { + yield * []; +} + +//// [asyncGenerators.functionExpression.13.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator([], "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.symbols new file mode 100644 index 00000000000..c1b7828204c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.13.es5.ts, 0, 5)) + + yield * []; +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.types new file mode 100644 index 00000000000..92426c67841 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.13.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts === +const f = async function * () { +>f : () => AsyncIterableIterator +>async function * () { yield * [];} : () => AsyncIterableIterator + + yield * []; +>yield * [] : any +>[] : undefined[] +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.js new file mode 100644 index 00000000000..f668fa8b872 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.js @@ -0,0 +1,63 @@ +//// [asyncGenerators.functionExpression.14.es5.ts] +const f = async function * () { + yield * f(); +} + +//// [asyncGenerators.functionExpression.14.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator(f(), "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.symbols new file mode 100644 index 00000000000..c63a96d1c0f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.14.es5.ts, 0, 5)) + + yield * f(); +>f : Symbol(f, Decl(asyncGenerators.functionExpression.14.es5.ts, 0, 5)) +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.types new file mode 100644 index 00000000000..5bcd1db7bf7 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.14.es5.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts === +const f = async function * () { +>f : () => any +>async function * () { yield * f();} : () => any + + yield * f(); +>yield * f() : any +>f() : any +>f : () => any +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.js new file mode 100644 index 00000000000..f2bc0d53763 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionExpression.15.es5.ts] +const f = async function * () { + await 1; +} + +//// [asyncGenerators.functionExpression.15.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.symbols new file mode 100644 index 00000000000..305a0942676 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.15.es5.ts, 0, 5)) + + await 1; +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.types new file mode 100644 index 00000000000..dd2a5bef1ad --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.15.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts === +const f = async function * () { +>f : () => AsyncIterableIterator +>async function * () { await 1;} : () => AsyncIterableIterator + + await 1; +>await 1 : 1 +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.errors.txt new file mode 100644 index 00000000000..0c8ae2fc12b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts(2,10): error TS1109: Expression expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts (1 errors) ==== + const f = async function * () { + await; + ~ +!!! error TS1109: Expression expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.js new file mode 100644 index 00000000000..de965d63979 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.16.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.functionExpression.16.es5.ts] +const f = async function * () { + await; +} + +//// [asyncGenerators.functionExpression.16.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.errors.txt new file mode 100644 index 00000000000..429b411167a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts(2,12): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts (1 errors) ==== + const f = async function * () { + var x: await; + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.js new file mode 100644 index 00000000000..716a6215ad3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.17.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.functionExpression.17.es5.ts] +const f = async function * () { + var x: await; +} + +//// [asyncGenerators.functionExpression.17.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.errors.txt new file mode 100644 index 00000000000..db3454aa77a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts(2,12): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts (1 errors) ==== + const f = async function * () { + var x: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.js new file mode 100644 index 00000000000..ba69ed4b705 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.18.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.functionExpression.18.es5.ts] +const f = async function * () { + var x: yield; +} + +//// [asyncGenerators.functionExpression.18.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.js new file mode 100644 index 00000000000..131dbdad9fa --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.functionExpression.19.es5.ts] +const f = async function *() { + var x = { [yield]: 1 }; +} + +//// [asyncGenerators.functionExpression.19.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + var x, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = {}; + return [4 /*yield*/, ["yield"]]; + case 1: + x = (_a[_b.sent()] = 1, _a); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.symbols new file mode 100644 index 00000000000..e1a129fcd8f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts === +const f = async function *() { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.19.es5.ts, 0, 5)) + + var x = { [yield]: 1 }; +>x : Symbol(x, Decl(asyncGenerators.functionExpression.19.es5.ts, 1, 7)) +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.types new file mode 100644 index 00000000000..3bb7726440e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.19.es5.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts === +const f = async function *() { +>f : () => AsyncIterableIterator +>async function *() { var x = { [yield]: 1 };} : () => AsyncIterableIterator + + var x = { [yield]: 1 }; +>x : { [x: number]: number; } +>{ [yield]: 1 } : { [x: number]: number; } +>yield : any +>1 : 1 +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.js new file mode 100644 index 00000000000..409cd83bef0 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionExpression.2.es5.ts] +const await = async function * () {} + +//// [asyncGenerators.functionExpression.2.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var await = function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); }; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.symbols new file mode 100644 index 00000000000..7ebf5316354 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts === +const await = async function * () {} +>await : Symbol(await, Decl(asyncGenerators.functionExpression.2.es5.ts, 0, 5)) + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.types new file mode 100644 index 00000000000..d192e67b1b2 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.2.es5.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts === +const await = async function * () {} +>await : () => AsyncIterableIterator +>async function * () {} : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.js new file mode 100644 index 00000000000..44f4df3a02a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionExpression.3.es5.ts] +const yield = async function * () {} + +//// [asyncGenerators.functionExpression.3.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var yield = function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); }; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.symbols new file mode 100644 index 00000000000..0fd4ab8ea66 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts === +const yield = async function * () {} +>yield : Symbol(yield, Decl(asyncGenerators.functionExpression.3.es5.ts, 0, 5)) + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.types new file mode 100644 index 00000000000..39758873e7c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.3.es5.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts === +const yield = async function * () {} +>yield : () => AsyncIterableIterator +>async function * () {} : () => AsyncIterableIterator + diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.errors.txt new file mode 100644 index 00000000000..23c43bc2c61 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts(1,29): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts(1,34): error TS1005: ',' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts (2 errors) ==== + const f = async function * (await) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ',' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.js new file mode 100644 index 00000000000..55b01735e4b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.4.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionExpression.4.es5.ts] +const f = async function * (await) {} + +//// [asyncGenerators.functionExpression.4.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); }, await, _a = void 0; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.errors.txt new file mode 100644 index 00000000000..5943fcfe2a2 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts(1,29): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts(1,34): error TS1005: ',' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts (2 errors) ==== + const f = async function * (yield) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ',' expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.js new file mode 100644 index 00000000000..60f12a38a22 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.5.es5.js @@ -0,0 +1,46 @@ +//// [asyncGenerators.functionExpression.5.es5.ts] +const f = async function * (yield) {} + +//// [asyncGenerators.functionExpression.5.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; +}); }); }, yield, _a = void 0; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.errors.txt new file mode 100644 index 00000000000..fc5e224a62d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts(1,33): error TS2524: 'await' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts (1 errors) ==== + const f = async function * (a = await 1) {} + ~~~~~~~ +!!! error TS2524: 'await' expressions cannot be used in a parameter initializer. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.js new file mode 100644 index 00000000000..cb7a8ebbb8a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.6.es5.js @@ -0,0 +1,49 @@ +//// [asyncGenerators.functionExpression.6.es5.ts] +const f = async function * (a = await 1) {} + +//// [asyncGenerators.functionExpression.6.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function (a) { + if (a === void 0) { a = yield ["await", 1]; } + return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.errors.txt new file mode 100644 index 00000000000..1efbda93528 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts(1,33): error TS2523: 'yield' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts (1 errors) ==== + const f = async function * (a = yield) {} + ~~~~~ +!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.js new file mode 100644 index 00000000000..2f7563c4f4d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.7.es5.js @@ -0,0 +1,49 @@ +//// [asyncGenerators.functionExpression.7.es5.ts] +const f = async function * (a = yield) {} + +//// [asyncGenerators.functionExpression.7.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function (a) { + if (a === void 0) { a = yield ["yield"]; } + return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.js new file mode 100644 index 00000000000..6d44e9d7b76 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.js @@ -0,0 +1,60 @@ +//// [asyncGenerators.functionExpression.8.es5.ts] +const f = async function * () { + async function * g() { + } +} + +//// [asyncGenerators.functionExpression.8.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + function g() { + return __asyncGenerator(this, arguments, function g_1() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.symbols b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.symbols new file mode 100644 index 00000000000..2158c71993f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts === +const f = async function * () { +>f : Symbol(f, Decl(asyncGenerators.functionExpression.8.es5.ts, 0, 5)) + + async function * g() { +>g : Symbol(g, Decl(asyncGenerators.functionExpression.8.es5.ts, 0, 31)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.types b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.types new file mode 100644 index 00000000000..38ad490b67e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.8.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts === +const f = async function * () { +>f : () => AsyncIterableIterator +>async function * () { async function * g() { }} : () => AsyncIterableIterator + + async function * g() { +>g : () => AsyncIterableIterator + } +} diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.errors.txt b/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.errors.txt new file mode 100644 index 00000000000..5674ced3368 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts(2,22): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts(2,30): error TS1005: '=>' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts (2 errors) ==== + const f = async function * () { + async function * yield() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: '=>' expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.js b/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.js new file mode 100644 index 00000000000..165e20c6f6f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.functionExpression.9.es5.js @@ -0,0 +1,62 @@ +//// [asyncGenerators.functionExpression.9.es5.ts] +const f = async function * () { + async function * yield() { + } +} + +//// [asyncGenerators.functionExpression.9.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var f = function () { + return __asyncGenerator(this, arguments, function () { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", function () { + }]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.js new file mode 100644 index 00000000000..36af7381f75 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.js @@ -0,0 +1,51 @@ +//// [asyncGenerators.objectLiteralMethod.1.es5.ts] +const x = { + async * f() {} +} + + +//// [asyncGenerators.objectLiteralMethod.1.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.symbols new file mode 100644 index 00000000000..550e0ccca2b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.1.es5.ts, 0, 5)) + + async * f() {} +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.1.es5.ts, 0, 11)) +} + diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.types new file mode 100644 index 00000000000..22c0a659a7e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.1.es5.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() {}} : { f(): AsyncIterableIterator; } + + async * f() {} +>f : () => AsyncIterableIterator +} + diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.errors.txt new file mode 100644 index 00000000000..2e0256a0978 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts(3,26): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts(3,32): error TS1109: Expression expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts(3,34): error TS1005: ';' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts (3 errors) ==== + const x = { + async * f() { + async function * await() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.js new file mode 100644 index 00000000000..76f6aaff29d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.10.es5.js @@ -0,0 +1,67 @@ +//// [asyncGenerators.objectLiteralMethod.10.es5.ts] +const x = { + async * f() { + async function * await() { + } + } +} + +//// [asyncGenerators.objectLiteralMethod.10.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ()]]; + case 1: + _a.sent(); + { + } + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.js new file mode 100644 index 00000000000..2744c232931 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.js @@ -0,0 +1,61 @@ +//// [asyncGenerators.objectLiteralMethod.11.es5.ts] +const x = { + async * f() { + yield; + } +} + +//// [asyncGenerators.objectLiteralMethod.11.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield"]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.symbols new file mode 100644 index 00000000000..03d3b8337a3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.11.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.11.es5.ts, 0, 11)) + + yield; + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.types new file mode 100644 index 00000000000..2410d56b501 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.11.es5.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { yield; }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + yield; +>yield : any + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.js new file mode 100644 index 00000000000..51d217cc84b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.js @@ -0,0 +1,61 @@ +//// [asyncGenerators.objectLiteralMethod.12.es5.ts] +const x = { + async * f() { + yield 1; + } +} + +//// [asyncGenerators.objectLiteralMethod.12.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.symbols new file mode 100644 index 00000000000..346262da113 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.12.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.12.es5.ts, 0, 11)) + + yield 1; + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.types new file mode 100644 index 00000000000..97aad265779 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.12.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator<1>; } +>{ async * f() { yield 1; }} : { f(): AsyncIterableIterator<1>; } + + async * f() { +>f : () => AsyncIterableIterator<1> + + yield 1; +>yield 1 : any +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.js new file mode 100644 index 00000000000..abac631503f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.js @@ -0,0 +1,67 @@ +//// [asyncGenerators.objectLiteralMethod.13.es5.ts] +const x = { + async * f() { + yield * []; + } +} + +//// [asyncGenerators.objectLiteralMethod.13.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator([], "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.symbols new file mode 100644 index 00000000000..5098e87f655 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.13.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.13.es5.ts, 0, 11)) + + yield * []; + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.types new file mode 100644 index 00000000000..aaa385d222a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.13.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { yield * []; }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + yield * []; +>yield * [] : any +>[] : undefined[] + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.js new file mode 100644 index 00000000000..e39b9e4841d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.js @@ -0,0 +1,68 @@ +//// [asyncGenerators.objectLiteralMethod.14.es5.ts] +declare const ai: AsyncIterable; +const x = { + async * f() { + yield * ai; + } +} + +//// [asyncGenerators.objectLiteralMethod.14.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }; + return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { return function (v) { return { value: ["delegate", (o[n] || f).call(o, v)], done: false }; }; } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; }; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [5 /*yield**/, __values(__asyncDelegator(ai, "__iterator__"))]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.symbols new file mode 100644 index 00000000000..f36ff7d28f4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts === +declare const ai: AsyncIterable; +>ai : Symbol(ai, Decl(asyncGenerators.objectLiteralMethod.14.es5.ts, 0, 13)) +>AsyncIterable : Symbol(AsyncIterable, Decl(lib.es2017.asynciterable.d.ts, --, --)) + +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.14.es5.ts, 1, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.14.es5.ts, 1, 11)) + + yield * ai; +>ai : Symbol(ai, Decl(asyncGenerators.objectLiteralMethod.14.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.types new file mode 100644 index 00000000000..e2d64798f68 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.14.es5.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts === +declare const ai: AsyncIterable; +>ai : AsyncIterable +>AsyncIterable : AsyncIterable + +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { yield * ai; }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + yield * ai; +>yield * ai : any +>ai : AsyncIterable + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.js new file mode 100644 index 00000000000..b63b63043c3 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.js @@ -0,0 +1,61 @@ +//// [asyncGenerators.objectLiteralMethod.15.es5.ts] +const x = { + async * f() { + await 1; + } +} + +//// [asyncGenerators.objectLiteralMethod.15.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", 1]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.symbols new file mode 100644 index 00000000000..2be552d0ed6 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.15.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.15.es5.ts, 0, 11)) + + await 1; + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.types new file mode 100644 index 00000000000..6e65d4fcec2 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.15.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { await 1; }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + await 1; +>await 1 : 1 +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.errors.txt new file mode 100644 index 00000000000..f8a27720cda --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts(3,14): error TS1109: Expression expected. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts (1 errors) ==== + const x = { + async * f() { + await; + ~ +!!! error TS1109: Expression expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.js new file mode 100644 index 00000000000..2e6152a7dc4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.16.es5.js @@ -0,0 +1,61 @@ +//// [asyncGenerators.objectLiteralMethod.16.es5.ts] +const x = { + async * f() { + await; + } +} + +//// [asyncGenerators.objectLiteralMethod.16.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["await", ]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.errors.txt new file mode 100644 index 00000000000..f6dc342428c --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts(3,16): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts (1 errors) ==== + const x = { + async * f() { + var x: await; + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.js new file mode 100644 index 00000000000..df873ae506e --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.17.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.objectLiteralMethod.17.es5.ts] +const x = { + async * f() { + var x: await; + } +} + +//// [asyncGenerators.objectLiteralMethod.17.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.errors.txt new file mode 100644 index 00000000000..67d17d417c1 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts(3,16): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts (1 errors) ==== + const x = { + async * f() { + var x: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.js new file mode 100644 index 00000000000..90cd018b012 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.18.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.objectLiteralMethod.18.es5.ts] +const x = { + async * f() { + var x: yield; + } +} + +//// [asyncGenerators.objectLiteralMethod.18.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.js new file mode 100644 index 00000000000..c1212315543 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.objectLiteralMethod.19.es5.ts] +const x = { + async * f() { + var x = { [yield]: 1 }; + } +} + +//// [asyncGenerators.objectLiteralMethod.19.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + var x, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = {}; + return [4 /*yield*/, ["yield"]]; + case 1: + x = (_a[_b.sent()] = 1, _a); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.symbols new file mode 100644 index 00000000000..3b236e9f640 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.19.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.19.es5.ts, 0, 11)) + + var x = { [yield]: 1 }; +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.19.es5.ts, 2, 11)) + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.types new file mode 100644 index 00000000000..6017562d93b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.19.es5.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { var x = { [yield]: 1 }; }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + var x = { [yield]: 1 }; +>x : { [x: number]: number; } +>{ [yield]: 1 } : { [x: number]: number; } +>yield : any +>1 : 1 + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.js new file mode 100644 index 00000000000..f529c4a23b5 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.js @@ -0,0 +1,50 @@ +//// [asyncGenerators.objectLiteralMethod.2.es5.ts] +const x = { + async * await() {} +} + +//// [asyncGenerators.objectLiteralMethod.2.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + await: function () { return __asyncGenerator(this, arguments, function await_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.symbols new file mode 100644 index 00000000000..8de23232ce0 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.2.es5.ts, 0, 5)) + + async * await() {} +>await : Symbol(await, Decl(asyncGenerators.objectLiteralMethod.2.es5.ts, 0, 11)) +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.types new file mode 100644 index 00000000000..c2c2ad22359 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.2.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts === +const x = { +>x : { await(): AsyncIterableIterator; } +>{ async * await() {}} : { await(): AsyncIterableIterator; } + + async * await() {} +>await : () => AsyncIterableIterator +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.errors.txt new file mode 100644 index 00000000000..142ef9c7623 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts(3,16): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts (1 errors) ==== + const x = { + async * f() { + var x: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.js new file mode 100644 index 00000000000..2d76c94fa99 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.20.es5.js @@ -0,0 +1,57 @@ +//// [asyncGenerators.objectLiteralMethod.20.es5.ts] +const x = { + async * f() { + var x: yield; + } +} + +//// [asyncGenerators.objectLiteralMethod.20.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + var x; + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.errors.txt new file mode 100644 index 00000000000..000979d5563 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts(2,14): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts (1 errors) ==== + const x = { + async * [yield]() { + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.js new file mode 100644 index 00000000000..ceb10b3cbd4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.21.es5.js @@ -0,0 +1,56 @@ +//// [asyncGenerators.objectLiteralMethod.21.es5.ts] +const x = { + async * [yield]() { + } +} + +//// [asyncGenerators.objectLiteralMethod.21.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = (_a = {}, + _a[yield] = function () { + return __asyncGenerator(this, arguments, function _a() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }, + _a); +var _a; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.errors.txt new file mode 100644 index 00000000000..e927720d476 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts(2,14): error TS2304: Cannot find name 'await'. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts (1 errors) ==== + const x = { + async * [await]() { + ~~~~~ +!!! error TS2304: Cannot find name 'await'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.js new file mode 100644 index 00000000000..9cbda2ca9f4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.22.es5.js @@ -0,0 +1,56 @@ +//// [asyncGenerators.objectLiteralMethod.22.es5.ts] +const x = { + async * [await]() { + } +} + +//// [asyncGenerators.objectLiteralMethod.22.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = (_a = {}, + _a[await] = function () { + return __asyncGenerator(this, arguments, function _a() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + }, + _a); +var _a; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.js new file mode 100644 index 00000000000..09fb16a268f --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.js @@ -0,0 +1,50 @@ +//// [asyncGenerators.objectLiteralMethod.3.es5.ts] +const x = { + async * yield() {} +} + +//// [asyncGenerators.objectLiteralMethod.3.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + yield: function () { return __asyncGenerator(this, arguments, function yield_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.symbols new file mode 100644 index 00000000000..71a1b708ce0 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.3.es5.ts, 0, 5)) + + async * yield() {} +>yield : Symbol(yield, Decl(asyncGenerators.objectLiteralMethod.3.es5.ts, 0, 11)) +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.types new file mode 100644 index 00000000000..8536c88c726 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.3.es5.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts === +const x = { +>x : { yield(): AsyncIterableIterator; } +>{ async * yield() {}} : { yield(): AsyncIterableIterator; } + + async * yield() {} +>yield : () => AsyncIterableIterator +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.errors.txt new file mode 100644 index 00000000000..811162458ca --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts(2,15): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts(2,20): error TS1005: ':' expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts(2,22): error TS1136: Property assignment expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts (4 errors) ==== + const x = { + async * f(await) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1136: Property assignment expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.js new file mode 100644 index 00000000000..c355201c2c8 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.4.es5.js @@ -0,0 +1,50 @@ +//// [asyncGenerators.objectLiteralMethod.4.es5.ts] +const x = { + async * f(await) {} +} + +//// [asyncGenerators.objectLiteralMethod.4.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }, await: +}, _a = void 0; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.errors.txt new file mode 100644 index 00000000000..ebb5717edfc --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts(2,15): error TS1138: Parameter declaration expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts(2,20): error TS1005: ':' expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts(2,22): error TS1136: Property assignment expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts (4 errors) ==== + const x = { + async * f(yield) {} + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1136: Property assignment expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.js new file mode 100644 index 00000000000..c68e04116fa --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.5.es5.js @@ -0,0 +1,50 @@ +//// [asyncGenerators.objectLiteralMethod.5.es5.ts] +const x = { + async * f(yield) {} +} + +//// [asyncGenerators.objectLiteralMethod.5.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); }, yield: +}, _a = void 0; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.errors.txt new file mode 100644 index 00000000000..4e9964c6008 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts(2,19): error TS2524: 'await' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts (1 errors) ==== + const x = { + async * f(a = await 1) {} + ~~~~~~~ +!!! error TS2524: 'await' expressions cannot be used in a parameter initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.js new file mode 100644 index 00000000000..a413cf3c7a0 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.6.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.objectLiteralMethod.6.es5.ts] +const x = { + async * f(a = await 1) {} +} + +//// [asyncGenerators.objectLiteralMethod.6.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function (a) { + if (a === void 0) { a = yield ["await", 1]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.errors.txt new file mode 100644 index 00000000000..4c1b5120203 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts(2,19): error TS2523: 'yield' expressions cannot be used in a parameter initializer. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts (1 errors) ==== + const x = { + async * f(a = yield) {} + ~~~~~ +!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.js new file mode 100644 index 00000000000..609405b04a5 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.7.es5.js @@ -0,0 +1,53 @@ +//// [asyncGenerators.objectLiteralMethod.7.es5.ts] +const x = { + async * f(a = yield) {} +} + +//// [asyncGenerators.objectLiteralMethod.7.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function (a) { + if (a === void 0) { a = yield ["yield"]; } + return __asyncGenerator(this, arguments, function f_1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.js new file mode 100644 index 00000000000..c120bd877ea --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.js @@ -0,0 +1,64 @@ +//// [asyncGenerators.objectLiteralMethod.8.es5.ts] +const x = { + async * f() { + async function * g() { + } + } +} + +//// [asyncGenerators.objectLiteralMethod.8.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + function g() { + return __asyncGenerator(this, arguments, function g_1() { + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } + return __generator(this, function (_a) { + return [2 /*return*/]; + }); + }); + } +}; diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.symbols b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.symbols new file mode 100644 index 00000000000..981bf59e44a --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts === +const x = { +>x : Symbol(x, Decl(asyncGenerators.objectLiteralMethod.8.es5.ts, 0, 5)) + + async * f() { +>f : Symbol(f, Decl(asyncGenerators.objectLiteralMethod.8.es5.ts, 0, 11)) + + async function * g() { +>g : Symbol(g, Decl(asyncGenerators.objectLiteralMethod.8.es5.ts, 1, 17)) + } + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.types b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.types new file mode 100644 index 00000000000..f3bc95d246d --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.8.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts === +const x = { +>x : { f(): AsyncIterableIterator; } +>{ async * f() { async function * g() { } }} : { f(): AsyncIterableIterator; } + + async * f() { +>f : () => AsyncIterableIterator + + async function * g() { +>g : () => AsyncIterableIterator + } + } +} diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.errors.txt b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.errors.txt new file mode 100644 index 00000000000..93114548f2b --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts(3,26): error TS1003: Identifier expected. +tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts(3,34): error TS1005: '=>' expected. + + +==== tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts (2 errors) ==== + const x = { + async * f() { + async function * yield() { + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: '=>' expected. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.js b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.js new file mode 100644 index 00000000000..131033ec2b4 --- /dev/null +++ b/tests/baselines/reference/asyncGenerators.objectLiteralMethod.9.es5.js @@ -0,0 +1,66 @@ +//// [asyncGenerators.objectLiteralMethod.9.es5.ts] +const x = { + async * f() { + async function * yield() { + } + } +} + +//// [asyncGenerators.objectLiteralMethod.9.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +var x = { + f: function () { + return __asyncGenerator(this, arguments, function f_1() { + function () { return __asyncGenerator(this, arguments, function _1() { return __generator(this, function (_a) { + return [2 /*return*/]; + }); }); } + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, ["yield", function () { + }]]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } +}; diff --git a/tests/baselines/reference/forAwait.1.es5.errors.txt b/tests/baselines/reference/forAwait.1.es5.errors.txt new file mode 100644 index 00000000000..00b9bdd7b5c --- /dev/null +++ b/tests/baselines/reference/forAwait.1.es5.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts(2,5): error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + + +==== tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts (1 errors) ==== + declare const ai: AsyncIterable; + for await (const x of ai) { + ~~~~~ +!!! error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + } \ No newline at end of file diff --git a/tests/baselines/reference/forAwait.1.es5.js b/tests/baselines/reference/forAwait.1.es5.js new file mode 100644 index 00000000000..dfe0e8e8ead --- /dev/null +++ b/tests/baselines/reference/forAwait.1.es5.js @@ -0,0 +1,19 @@ +//// [forAwait.1.es5.ts] +declare const ai: AsyncIterable; +for await (const x of ai) { +} + +//// [forAwait.1.es5.js] +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +try { + for (var ai_1 = { iterator: __asyncValues(ai, "__iterator__") }; yield __asyncStep(ai_1);) { + var x = ai_1.result.value; + } +} +catch (e_1_1) { e_1 = { error: e_1_1 }; } +finally { + try { yield __close(ai_1); } finally { if (e_1) throw e_1.error; } +} +var e_1; diff --git a/tests/baselines/reference/forAwait.2.es5.errors.txt b/tests/baselines/reference/forAwait.2.es5.errors.txt new file mode 100644 index 00000000000..a4ddf4bf52a --- /dev/null +++ b/tests/baselines/reference/forAwait.2.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts(3,9): error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + + +==== tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts (1 errors) ==== + declare const ai: AsyncIterable; + function f() { + for await (const x of ai) { + ~~~~~ +!!! error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/forAwait.2.es5.js b/tests/baselines/reference/forAwait.2.es5.js new file mode 100644 index 00000000000..707be79e748 --- /dev/null +++ b/tests/baselines/reference/forAwait.2.es5.js @@ -0,0 +1,23 @@ +//// [forAwait.2.es5.ts] +declare const ai: AsyncIterable; +function f() { + for await (const x of ai) { + } +} + +//// [forAwait.2.es5.js] +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +function f() { + try { + for (var ai_1 = { iterator: __asyncValues(ai, "__iterator__") }; yield __asyncStep(ai_1);) { + var x = ai_1.result.value; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { yield __close(ai_1); } finally { if (e_1) throw e_1.error; } + } + var e_1; +} diff --git a/tests/baselines/reference/forAwait.3.es5.js b/tests/baselines/reference/forAwait.3.es5.js new file mode 100644 index 00000000000..ecca2200921 --- /dev/null +++ b/tests/baselines/reference/forAwait.3.es5.js @@ -0,0 +1,82 @@ +//// [forAwait.3.es5.ts] +declare const ai: AsyncIterable; +async function f() { + for await (const x of ai) { + } +} + +//// [forAwait.3.es5.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +function f() { + return __awaiter(this, void 0, void 0, function () { + var ai_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + ai_1 = { iterator: __asyncValues(ai, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, __asyncStep(ai_1)]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = ai_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, __close(ai_1)]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/forAwait.3.es5.symbols b/tests/baselines/reference/forAwait.3.es5.symbols new file mode 100644 index 00000000000..c4e50ce35a6 --- /dev/null +++ b/tests/baselines/reference/forAwait.3.es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts === +declare const ai: AsyncIterable; +>ai : Symbol(ai, Decl(forAwait.3.es5.ts, 0, 13)) +>AsyncIterable : Symbol(AsyncIterable, Decl(lib.es2017.asynciterable.d.ts, --, --)) + +async function f() { +>f : Symbol(f, Decl(forAwait.3.es5.ts, 0, 40)) + + for await (const x of ai) { +>x : Symbol(x, Decl(forAwait.3.es5.ts, 2, 20)) +>ai : Symbol(ai, Decl(forAwait.3.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/forAwait.3.es5.types b/tests/baselines/reference/forAwait.3.es5.types new file mode 100644 index 00000000000..73a50781934 --- /dev/null +++ b/tests/baselines/reference/forAwait.3.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts === +declare const ai: AsyncIterable; +>ai : AsyncIterable +>AsyncIterable : AsyncIterable + +async function f() { +>f : () => Promise + + for await (const x of ai) { +>x : number +>ai : AsyncIterable + } +} diff --git a/tests/baselines/reference/forAwait.4.es5.js b/tests/baselines/reference/forAwait.4.es5.js new file mode 100644 index 00000000000..2c728c28d44 --- /dev/null +++ b/tests/baselines/reference/forAwait.4.es5.js @@ -0,0 +1,82 @@ +//// [forAwait.4.es5.ts] +declare const i: Iterable; +async function f() { + for await (const x of i) { + } +} + +//// [forAwait.4.es5.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +function f() { + return __awaiter(this, void 0, void 0, function () { + var i_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + i_1 = { iterator: __asyncValues(i, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, __asyncStep(i_1)]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = i_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, __close(i_1)]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/forAwait.4.es5.symbols b/tests/baselines/reference/forAwait.4.es5.symbols new file mode 100644 index 00000000000..d1a5b3881a4 --- /dev/null +++ b/tests/baselines/reference/forAwait.4.es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts === +declare const i: Iterable; +>i : Symbol(i, Decl(forAwait.4.es5.ts, 0, 13)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) + +async function f() { +>f : Symbol(f, Decl(forAwait.4.es5.ts, 0, 34)) + + for await (const x of i) { +>x : Symbol(x, Decl(forAwait.4.es5.ts, 2, 20)) +>i : Symbol(i, Decl(forAwait.4.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/forAwait.4.es5.types b/tests/baselines/reference/forAwait.4.es5.types new file mode 100644 index 00000000000..c4a519781a5 --- /dev/null +++ b/tests/baselines/reference/forAwait.4.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts === +declare const i: Iterable; +>i : Iterable +>Iterable : Iterable + +async function f() { +>f : () => Promise + + for await (const x of i) { +>x : number +>i : Iterable + } +} diff --git a/tests/baselines/reference/forAwait.5.es5.js b/tests/baselines/reference/forAwait.5.es5.js new file mode 100644 index 00000000000..6ded222b149 --- /dev/null +++ b/tests/baselines/reference/forAwait.5.es5.js @@ -0,0 +1,86 @@ +//// [forAwait.5.es5.ts] +declare const ai: AsyncIterable; +async function* f() { + for await (const x of ai) { + } +} + +//// [forAwait.5.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var ai_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + ai_1 = { iterator: __asyncValues(ai, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, ["await", __asyncStep(ai_1)]]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = ai_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, ["await", __close(ai_1)]]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/forAwait.5.es5.symbols b/tests/baselines/reference/forAwait.5.es5.symbols new file mode 100644 index 00000000000..99bfdda0232 --- /dev/null +++ b/tests/baselines/reference/forAwait.5.es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts === +declare const ai: AsyncIterable; +>ai : Symbol(ai, Decl(forAwait.5.es5.ts, 0, 13)) +>AsyncIterable : Symbol(AsyncIterable, Decl(lib.es2017.asynciterable.d.ts, --, --)) + +async function* f() { +>f : Symbol(f, Decl(forAwait.5.es5.ts, 0, 40)) + + for await (const x of ai) { +>x : Symbol(x, Decl(forAwait.5.es5.ts, 2, 20)) +>ai : Symbol(ai, Decl(forAwait.5.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/forAwait.5.es5.types b/tests/baselines/reference/forAwait.5.es5.types new file mode 100644 index 00000000000..a57699e23d0 --- /dev/null +++ b/tests/baselines/reference/forAwait.5.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts === +declare const ai: AsyncIterable; +>ai : AsyncIterable +>AsyncIterable : AsyncIterable + +async function* f() { +>f : () => AsyncIterableIterator + + for await (const x of ai) { +>x : number +>ai : AsyncIterable + } +} diff --git a/tests/baselines/reference/forAwait.6.es5.js b/tests/baselines/reference/forAwait.6.es5.js new file mode 100644 index 00000000000..679fbacb749 --- /dev/null +++ b/tests/baselines/reference/forAwait.6.es5.js @@ -0,0 +1,86 @@ +//// [forAwait.6.es5.ts] +declare const i: Iterable; +async function* f() { + for await (const x of i) { + } +} + +//// [forAwait.6.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + var g = generator.apply(thisArg, _arguments || []), q = [], c, i; + return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; } + function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } } + function step(r) { r.done ? settle(c[2], r) : r.value[0] === "yield" ? settle(c[2], { value: r.value[1], done: false }) : Promise.resolve(r.value[1]).then(r.value[0] === "delegate" ? delegate : fulfill, reject); } + function delegate(r) { step(r.done ? r : { value: ["yield", r.value], done: false }); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { c = void 0, f(v), next(); } +}; +function f() { + return __asyncGenerator(this, arguments, function f_1() { + var i_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + i_1 = { iterator: __asyncValues(i, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, ["await", __asyncStep(i_1)]]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = i_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, ["await", __close(i_1)]]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/forAwait.6.es5.symbols b/tests/baselines/reference/forAwait.6.es5.symbols new file mode 100644 index 00000000000..7789dd32d15 --- /dev/null +++ b/tests/baselines/reference/forAwait.6.es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts === +declare const i: Iterable; +>i : Symbol(i, Decl(forAwait.6.es5.ts, 0, 13)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) + +async function* f() { +>f : Symbol(f, Decl(forAwait.6.es5.ts, 0, 34)) + + for await (const x of i) { +>x : Symbol(x, Decl(forAwait.6.es5.ts, 2, 20)) +>i : Symbol(i, Decl(forAwait.6.es5.ts, 0, 13)) + } +} diff --git a/tests/baselines/reference/forAwait.6.es5.types b/tests/baselines/reference/forAwait.6.es5.types new file mode 100644 index 00000000000..5d2664815a3 --- /dev/null +++ b/tests/baselines/reference/forAwait.6.es5.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts === +declare const i: Iterable; +>i : Iterable +>Iterable : Iterable + +async function* f() { +>f : () => AsyncIterableIterator + + for await (const x of i) { +>x : number +>i : Iterable + } +} diff --git a/tests/baselines/reference/forAwait.7.es5.errors.txt b/tests/baselines/reference/forAwait.7.es5.errors.txt new file mode 100644 index 00000000000..2c59ae123dd --- /dev/null +++ b/tests/baselines/reference/forAwait.7.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts(3,9): error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + + +==== tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts (1 errors) ==== + declare const ai: AsyncIterable; + function* f() { + for await (const x of ai) { + ~~~~~ +!!! error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/forAwait.7.es5.js b/tests/baselines/reference/forAwait.7.es5.js new file mode 100644 index 00000000000..0feb8dd8c9f --- /dev/null +++ b/tests/baselines/reference/forAwait.7.es5.js @@ -0,0 +1,72 @@ +//// [forAwait.7.es5.ts] +declare const ai: AsyncIterable; +function* f() { + for await (const x of ai) { + } +} + +//// [forAwait.7.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +function f() { + var ai_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + ai_1 = { iterator: __asyncValues(ai, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, ["await", __asyncStep(ai_1)]]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = ai_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, ["await", __close(ai_1)]]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); +} diff --git a/tests/baselines/reference/forAwait.8.es5.errors.txt b/tests/baselines/reference/forAwait.8.es5.errors.txt new file mode 100644 index 00000000000..0db27e28c7f --- /dev/null +++ b/tests/baselines/reference/forAwait.8.es5.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts(3,9): error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + + +==== tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts (1 errors) ==== + declare const i: Iterable; + function* f() { + for await (const x of i) { + ~~~~~ +!!! error TS1104: A 'for-await-of' statement is only allowed within an async function or async generator. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/forAwait.8.es5.js b/tests/baselines/reference/forAwait.8.es5.js new file mode 100644 index 00000000000..62f1c8b3610 --- /dev/null +++ b/tests/baselines/reference/forAwait.8.es5.js @@ -0,0 +1,72 @@ +//// [forAwait.8.es5.ts] +declare const i: Iterable; +function* f() { + for await (const x of i) { + } +} + +//// [forAwait.8.es5.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncStep = (this && this.__asyncStep) || function (r) { return !r.done && Promise.resolve(r.iterator.next()).then(function (_) { return !(r.done = (r.result = _).done); }); }; +var __asyncValues = (this && this.__asyncIterator) || function (o) { return (m = o[Symbol.asyncIterator]) ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); var m; }; +var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; }; +function f() { + var i_1, x, _a, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 5, 6, 10]); + i_1 = { iterator: __asyncValues(i, "__iterator__") }; + _b.label = 1; + case 1: return [4 /*yield*/, ["await", __asyncStep(i_1)]]; + case 2: + if (!_b.sent()) + return [3 /*break*/, 4]; + x = i_1.result.value; + _b.label = 3; + case 3: return [3 /*break*/, 1]; + case 4: return [3 /*break*/, 10]; + case 5: + _a = _b.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 10]; + case 6: + _b.trys.push([6, , 8, 9]); + return [4 /*yield*/, ["await", __close(i_1)]]; + case 7: + _b.sent(); + return [3 /*break*/, 9]; + case 8: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 9: return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); +} diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts new file mode 100644 index 00000000000..bf3e115f3ba --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.1.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() {} +} diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts new file mode 100644 index 00000000000..356864ab723 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.10.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + async function * await() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts new file mode 100644 index 00000000000..0bddf141e66 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.11.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts new file mode 100644 index 00000000000..639926bf50b --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.12.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + yield 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts new file mode 100644 index 00000000000..36e2f78772a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.13.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + yield * []; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts new file mode 100644 index 00000000000..1a287230db8 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.14.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +class C { + async * f() { + yield * ai; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts new file mode 100644 index 00000000000..769abba272c --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.15.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + await 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts new file mode 100644 index 00000000000..314ed6f42a7 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.16.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + await; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts new file mode 100644 index 00000000000..3eae35d74ad --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.17.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + var x: await; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts new file mode 100644 index 00000000000..84c5f86b8f6 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.18.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + var x: yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts new file mode 100644 index 00000000000..7028376e7b7 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.19.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + var x = { [yield]: 1 }; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts new file mode 100644 index 00000000000..a1b9857bc16 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.2.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * await() {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts new file mode 100644 index 00000000000..84c5f86b8f6 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.20.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + var x: yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts new file mode 100644 index 00000000000..41f98bea60a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.21.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +class C { + async * [yield]() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts new file mode 100644 index 00000000000..e815dea4b9f --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.22.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +class C { + async * [await]() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts new file mode 100644 index 00000000000..5ce290f4beb --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.3.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * yield() {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts new file mode 100644 index 00000000000..d9b7c0874bf --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.4.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f(await) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts new file mode 100644 index 00000000000..a1c4c257f6a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.5.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f(yield) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts new file mode 100644 index 00000000000..6621702506d --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.6.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f(a = await 1) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts new file mode 100644 index 00000000000..7cd92fe9f79 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.7.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f(a = yield) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts new file mode 100644 index 00000000000..dd80c59f63e --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.8.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + async function * g() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts new file mode 100644 index 00000000000..fc08df1d846 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/classMethods/asyncGenerators.classMethod.9.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +class C { + async * f() { + async function * yield() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts new file mode 100644 index 00000000000..ac167018e2e --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.1.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * f() {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts new file mode 100644 index 00000000000..8eea4254b7a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.10.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + async function * await() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts new file mode 100644 index 00000000000..f884f2f7c32 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.11.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts new file mode 100644 index 00000000000..486c1ec435b --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.12.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + yield 1; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts new file mode 100644 index 00000000000..eff15cb3423 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.13.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + yield * []; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts new file mode 100644 index 00000000000..4261a5a8ccd --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.14.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + yield * f(); +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts new file mode 100644 index 00000000000..4297eccf73f --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.15.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + await 1; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts new file mode 100644 index 00000000000..e3a691db815 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.16.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + await; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts new file mode 100644 index 00000000000..e65441b3d55 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.17.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + var x: await; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts new file mode 100644 index 00000000000..99a7a5b6ca2 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.18.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + var x: yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts new file mode 100644 index 00000000000..1683985971c --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.19.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + var x = { [yield]: 1 }; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts new file mode 100644 index 00000000000..d6f4be43641 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.2.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * await() {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts new file mode 100644 index 00000000000..99a7a5b6ca2 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.20.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + var x: yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts new file mode 100644 index 00000000000..9231b5ee5e0 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.3.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * yield() {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts new file mode 100644 index 00000000000..04dc7e49155 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.4.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * f(await) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts new file mode 100644 index 00000000000..33a5d258fb9 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.5.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * f(yield) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts new file mode 100644 index 00000000000..7b443a5a069 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.6.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * f(a = await 1) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts new file mode 100644 index 00000000000..9f40ea5d474 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.7.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +async function * f(a = yield) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts new file mode 100644 index 00000000000..213fae8fec0 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.8.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + async function * g() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts new file mode 100644 index 00000000000..6fd6926f138 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionDeclarations/asyncGenerators.functionDeclaration.9.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +async function * f() { + async function * yield() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts new file mode 100644 index 00000000000..4754d498c0c --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.1.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts new file mode 100644 index 00000000000..8d94b636f7f --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.10.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + async function * await() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts new file mode 100644 index 00000000000..de478b032e9 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.11.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts new file mode 100644 index 00000000000..6e7451ba90a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.12.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + yield 1; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts new file mode 100644 index 00000000000..0380608e240 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.13.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + yield * []; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts new file mode 100644 index 00000000000..a3beb93cdee --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.14.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + yield * f(); +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts new file mode 100644 index 00000000000..5273a817016 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.15.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + await 1; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts new file mode 100644 index 00000000000..974685d397c --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.16.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + await; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts new file mode 100644 index 00000000000..5f7399cc31d --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.17.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + var x: await; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts new file mode 100644 index 00000000000..b8e8e86a9e0 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.18.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + var x: yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts new file mode 100644 index 00000000000..292c4082c62 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.19.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const f = async function *() { + var x = { [yield]: 1 }; +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts new file mode 100644 index 00000000000..871414be290 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.2.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const await = async function * () {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts new file mode 100644 index 00000000000..8bbdc903918 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.3.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const yield = async function * () {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts new file mode 100644 index 00000000000..94cc6b2b4c4 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.4.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const f = async function * (await) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts new file mode 100644 index 00000000000..1ea66c87ec4 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.5.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const f = async function * (yield) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts new file mode 100644 index 00000000000..a325ad9fe51 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.6.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const f = async function * (a = await 1) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts new file mode 100644 index 00000000000..82d940075b7 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.7.es5.ts @@ -0,0 +1,3 @@ +// @target: es5 +// @lib: es2017 +const f = async function * (a = yield) {} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts new file mode 100644 index 00000000000..2162e3f282a --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.8.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + async function * g() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts new file mode 100644 index 00000000000..a53a55be5a5 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/functionExpressions/asyncGenerators.functionExpression.9.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +const f = async function * () { + async function * yield() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts new file mode 100644 index 00000000000..b4a20869847 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.1.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() {} +} diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts new file mode 100644 index 00000000000..ee84baaccf9 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.10.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + async function * await() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts new file mode 100644 index 00000000000..b4525f1c654 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.11.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts new file mode 100644 index 00000000000..b2249a800ad --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.12.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + yield 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts new file mode 100644 index 00000000000..cb6bccaa35d --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.13.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + yield * []; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts new file mode 100644 index 00000000000..e4227fc802f --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.14.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +const x = { + async * f() { + yield * ai; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts new file mode 100644 index 00000000000..bb61857da64 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.15.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + await 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts new file mode 100644 index 00000000000..dccc3e3d9b6 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.16.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + await; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts new file mode 100644 index 00000000000..c046f6b9621 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.17.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + var x: await; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts new file mode 100644 index 00000000000..c3c04173ec7 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.18.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + var x: yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts new file mode 100644 index 00000000000..4cc73437c03 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.19.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + var x = { [yield]: 1 }; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts new file mode 100644 index 00000000000..1167a8f47b1 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.2.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * await() {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts new file mode 100644 index 00000000000..c3c04173ec7 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.20.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + var x: yield; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts new file mode 100644 index 00000000000..8a51f9d4402 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.21.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * [yield]() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts new file mode 100644 index 00000000000..8b214281782 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.22.es5.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * [await]() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts new file mode 100644 index 00000000000..16296c5d478 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.3.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * yield() {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts new file mode 100644 index 00000000000..0f8c2b3dc03 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.4.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f(await) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts new file mode 100644 index 00000000000..c425b8df9ba --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.5.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f(yield) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts new file mode 100644 index 00000000000..b917a800257 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.6.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f(a = await 1) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts new file mode 100644 index 00000000000..889bf36c28c --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.7.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f(a = yield) {} +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts new file mode 100644 index 00000000000..80cb80a95eb --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.8.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + async function * g() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts new file mode 100644 index 00000000000..cf9e2284e63 --- /dev/null +++ b/tests/cases/conformance/asyncGenerators/es5/objectLiteralMethods/asyncGenerators.objectLiteralMethod.9.es5.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @lib: es2017 +const x = { + async * f() { + async function * yield() { + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts new file mode 100644 index 00000000000..30f07888601 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.1.es5.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +for await (const x of ai) { +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts new file mode 100644 index 00000000000..88ed2d87bc7 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.2.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +function f() { + for await (const x of ai) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts new file mode 100644 index 00000000000..d0817b84b00 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.3.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +async function f() { + for await (const x of ai) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts new file mode 100644 index 00000000000..9efd1ac6e46 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.4.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const i: Iterable; +async function f() { + for await (const x of i) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts new file mode 100644 index 00000000000..b43bfad736b --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.5.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +async function* f() { + for await (const x of ai) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts new file mode 100644 index 00000000000..1c891356e4f --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.6.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const i: Iterable; +async function* f() { + for await (const x of i) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts new file mode 100644 index 00000000000..6a0323be288 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.7.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const ai: AsyncIterable; +function* f() { + for await (const x of ai) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts b/tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts new file mode 100644 index 00000000000..5a0e37472f1 --- /dev/null +++ b/tests/cases/conformance/forAwait/es5/forAwait.8.es5.ts @@ -0,0 +1,7 @@ +// @target: es5 +// @lib: es2017 +declare const i: Iterable; +function* f() { + for await (const x of i) { + } +} \ No newline at end of file