From 5b539f06361e1ce9cafd9cf3ec06efb350eb8b54 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 25 Nov 2014 12:16:31 -0800 Subject: [PATCH 1/2] Report errors for using yield/generators right now. --- .../diagnosticInformationMap.generated.ts | 2 ++ src/compiler/diagnosticMessages.json | 8 ++++++++ src/compiler/parser.ts | 19 +++++++++++++++---- .../FunctionDeclaration10_es6.errors.txt | 8 ++++++++ .../reference/FunctionDeclaration10_es6.js | 8 -------- .../reference/FunctionDeclaration10_es6.types | 8 -------- .../FunctionDeclaration11_es6.errors.txt | 8 ++++++++ .../reference/FunctionDeclaration11_es6.js | 7 ------- .../reference/FunctionDeclaration11_es6.types | 4 ---- .../FunctionDeclaration13_es6.errors.txt | 5 ++++- .../reference/FunctionDeclaration13_es6.js | 12 ------------ .../FunctionDeclaration1_es6.errors.txt | 8 ++++++++ .../reference/FunctionDeclaration1_es6.js | 7 ------- .../reference/FunctionDeclaration1_es6.types | 4 ---- .../FunctionDeclaration6_es6.errors.txt | 5 ++++- .../reference/FunctionDeclaration6_es6.js | 8 -------- .../FunctionDeclaration7_es6.errors.txt | 5 ++++- .../reference/FunctionDeclaration7_es6.js | 14 -------------- .../FunctionExpression1_es6.errors.txt | 7 +++++++ .../reference/FunctionExpression1_es6.js | 6 ------ .../reference/FunctionExpression1_es6.types | 5 ----- .../FunctionExpression2_es6.errors.txt | 7 +++++++ .../reference/FunctionExpression2_es6.js | 6 ------ .../reference/FunctionExpression2_es6.types | 6 ------ ...unctionPropertyAssignments1_es6.errors.txt | 7 +++++++ .../FunctionPropertyAssignments1_es6.js | 6 ------ .../FunctionPropertyAssignments1_es6.types | 7 ------- .../MemberFunctionDeclaration1_es6.errors.txt | 9 +++++++++ .../MemberFunctionDeclaration1_es6.js | 13 ------------- .../MemberFunctionDeclaration1_es6.types | 7 ------- .../MemberFunctionDeclaration2_es6.errors.txt | 9 +++++++++ .../MemberFunctionDeclaration2_es6.js | 13 ------------- .../MemberFunctionDeclaration2_es6.types | 7 ------- .../MemberFunctionDeclaration7_es6.errors.txt | 9 +++++++++ .../MemberFunctionDeclaration7_es6.js | 13 ------------- .../MemberFunctionDeclaration7_es6.types | 8 -------- .../YieldExpression10_es6.errors.txt | 11 +++++++++++ .../reference/YieldExpression10_es6.js | 11 ----------- .../reference/YieldExpression10_es6.types | 11 ----------- .../YieldExpression11_es6.errors.txt | 11 +++++++++++ .../reference/YieldExpression11_es6.js | 16 ---------------- .../reference/YieldExpression11_es6.types | 10 ---------- .../YieldExpression13_es6.errors.txt | 7 +++++++ .../reference/YieldExpression13_es6.js | 7 ------- .../reference/YieldExpression13_es6.types | 4 ---- .../YieldExpression16_es6.errors.txt | 6 +++--- .../YieldExpression19_es6.errors.txt | 13 +++++++++++++ .../reference/YieldExpression19_es6.js | 17 ----------------- .../reference/YieldExpression19_es6.types | 14 -------------- .../reference/YieldExpression3_es6.errors.txt | 10 ++++++++++ .../reference/YieldExpression3_es6.js | 11 ----------- .../reference/YieldExpression3_es6.types | 7 ------- .../reference/YieldExpression4_es6.errors.txt | 10 ++++++++++ .../reference/YieldExpression4_es6.js | 11 ----------- .../reference/YieldExpression4_es6.types | 7 ------- .../reference/YieldExpression6_es6.errors.txt | 9 +++++++++ .../reference/YieldExpression6_es6.js | 9 --------- .../reference/YieldExpression6_es6.types | 6 ------ .../reference/YieldExpression7_es6.errors.txt | 9 +++++++++ .../reference/YieldExpression7_es6.js | 9 --------- .../reference/YieldExpression7_es6.types | 6 ------ .../reference/YieldExpression8_es6.errors.txt | 5 ++++- .../reference/YieldExpression8_es6.js | 11 ----------- .../reference/YieldExpression9_es6.errors.txt | 9 +++++++++ .../reference/YieldExpression9_es6.js | 9 --------- .../reference/YieldExpression9_es6.types | 7 ------- .../templateStringInYieldKeyword.errors.txt | 11 +++++++++++ .../reference/templateStringInYieldKeyword.js | 12 ------------ .../templateStringInYieldKeyword.types | 9 --------- ...ringWithEmbeddedYieldKeywordES6.errors.txt | 11 +++++++++++ ...mplateStringWithEmbeddedYieldKeywordES6.js | 12 ------------ ...ateStringWithEmbeddedYieldKeywordES6.types | 9 --------- 72 files changed, 227 insertions(+), 405 deletions(-) create mode 100644 tests/baselines/reference/FunctionDeclaration10_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionDeclaration10_es6.js delete mode 100644 tests/baselines/reference/FunctionDeclaration10_es6.types create mode 100644 tests/baselines/reference/FunctionDeclaration11_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionDeclaration11_es6.js delete mode 100644 tests/baselines/reference/FunctionDeclaration11_es6.types delete mode 100644 tests/baselines/reference/FunctionDeclaration13_es6.js create mode 100644 tests/baselines/reference/FunctionDeclaration1_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionDeclaration1_es6.js delete mode 100644 tests/baselines/reference/FunctionDeclaration1_es6.types delete mode 100644 tests/baselines/reference/FunctionDeclaration6_es6.js delete mode 100644 tests/baselines/reference/FunctionDeclaration7_es6.js create mode 100644 tests/baselines/reference/FunctionExpression1_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionExpression1_es6.js delete mode 100644 tests/baselines/reference/FunctionExpression1_es6.types create mode 100644 tests/baselines/reference/FunctionExpression2_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionExpression2_es6.js delete mode 100644 tests/baselines/reference/FunctionExpression2_es6.types create mode 100644 tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt delete mode 100644 tests/baselines/reference/FunctionPropertyAssignments1_es6.js delete mode 100644 tests/baselines/reference/FunctionPropertyAssignments1_es6.types create mode 100644 tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration1_es6.js delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration1_es6.types create mode 100644 tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration2_es6.js delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration2_es6.types create mode 100644 tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration7_es6.js delete mode 100644 tests/baselines/reference/MemberFunctionDeclaration7_es6.types create mode 100644 tests/baselines/reference/YieldExpression10_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression10_es6.js delete mode 100644 tests/baselines/reference/YieldExpression10_es6.types create mode 100644 tests/baselines/reference/YieldExpression11_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression11_es6.js delete mode 100644 tests/baselines/reference/YieldExpression11_es6.types create mode 100644 tests/baselines/reference/YieldExpression13_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression13_es6.js delete mode 100644 tests/baselines/reference/YieldExpression13_es6.types create mode 100644 tests/baselines/reference/YieldExpression19_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression19_es6.js delete mode 100644 tests/baselines/reference/YieldExpression19_es6.types create mode 100644 tests/baselines/reference/YieldExpression3_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression3_es6.js delete mode 100644 tests/baselines/reference/YieldExpression3_es6.types create mode 100644 tests/baselines/reference/YieldExpression4_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression4_es6.js delete mode 100644 tests/baselines/reference/YieldExpression4_es6.types create mode 100644 tests/baselines/reference/YieldExpression6_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression6_es6.js delete mode 100644 tests/baselines/reference/YieldExpression6_es6.types create mode 100644 tests/baselines/reference/YieldExpression7_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression7_es6.js delete mode 100644 tests/baselines/reference/YieldExpression7_es6.types delete mode 100644 tests/baselines/reference/YieldExpression8_es6.js create mode 100644 tests/baselines/reference/YieldExpression9_es6.errors.txt delete mode 100644 tests/baselines/reference/YieldExpression9_es6.js delete mode 100644 tests/baselines/reference/YieldExpression9_es6.types create mode 100644 tests/baselines/reference/templateStringInYieldKeyword.errors.txt delete mode 100644 tests/baselines/reference/templateStringInYieldKeyword.js delete mode 100644 tests/baselines/reference/templateStringInYieldKeyword.types create mode 100644 tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt delete mode 100644 tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js delete mode 100644 tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index c877c6f9773eb..dbc77bb95b77b 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -414,5 +414,7 @@ module ts { _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: DiagnosticCategory.Error, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." }, + yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." }, + generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "'generators' are not currently supported." }, }; } \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5ee797482a9ea..4a5ce8f6f7000 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1654,5 +1654,13 @@ "You cannot rename this element.": { "category": "Error", "code": 8000 + }, + "'yield' expressions are not currently supported.": { + "category": "Error", + "code": 9000 + }, + "'generators' are not currently supported.": { + "category": "Error", + "code": 9001 } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 8d7bf9e4fe7d6..f0d333ee68e96 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4302,12 +4302,20 @@ module ts { function checkFunctionDeclaration(node: FunctionLikeDeclaration) { return checkAnyParsedSignature(node) || checkFunctionName(node.name) || - checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false); + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || + checkForGenerator(node); + } + + function checkForGenerator(node: Node) { + if (node.flags & NodeFlags.Generator) { + return grammarErrorOnFirstToken(node, Diagnostics.generators_are_not_currently_supported); + } } function checkFunctionExpression(node: FunctionExpression) { return checkAnyParsedSignature(node) || - checkFunctionName(node.name); + checkFunctionName(node.name) || + checkForGenerator(node); } function checkFunctionName(name: Node) { @@ -4386,7 +4394,8 @@ module ts { function checkMethod(node: MethodDeclaration) { return checkAnyParsedSignature(node) || checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || - (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)); + (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)) || + checkForGenerator(node); } function checkForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { @@ -4732,7 +4741,8 @@ module ts { } function checkPropertyAssignment(node: PropertyDeclaration) { - return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional) || + checkForGenerator(node); } function checkForInvalidQuestionMark(node: Declaration, message: DiagnosticMessage) { @@ -4963,6 +4973,7 @@ module ts { if (!(node.parserContextFlags & ParserContextFlags.Yield)) { return grammarErrorOnFirstToken(node, Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); } + return grammarErrorOnFirstToken(node, Diagnostics.yield_expressions_are_not_currently_supported); } } diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt new file mode 100644 index 0000000000000..4d167fbc3ecb2 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ==== + function * foo(a = yield => yield) { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.js b/tests/baselines/reference/FunctionDeclaration10_es6.js deleted file mode 100644 index 5169453396463..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration10_es6.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [FunctionDeclaration10_es6.ts] -function * foo(a = yield => yield) { -} - -//// [FunctionDeclaration10_es6.js] -function foo(a) { - if (a === void 0) { a = function (yield) { return yield; }; } -} diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.types b/tests/baselines/reference/FunctionDeclaration10_es6.types deleted file mode 100644 index 973de97fab165..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration10_es6.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts === -function * foo(a = yield => yield) { ->foo : (a?: (yield: any) => any) => void ->a : (yield: any) => any ->yield => yield : (yield: any) => any ->yield : any ->yield : any -} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt new file mode 100644 index 0000000000000..2b623b337512b --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ==== + function * yield() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.js b/tests/baselines/reference/FunctionDeclaration11_es6.js deleted file mode 100644 index ba497b3e529d7..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration11_es6.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [FunctionDeclaration11_es6.ts] -function * yield() { -} - -//// [FunctionDeclaration11_es6.js] -function yield() { -} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.types b/tests/baselines/reference/FunctionDeclaration11_es6.types deleted file mode 100644 index f57a385c3592a..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration11_es6.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts === -function * yield() { ->yield : () => void -} diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt index 1f921475fd330..f19e630418898 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,1): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'. -==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ==== function * foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. // Legal to use 'yield' in a type context. var v: yield; ~~~~~ diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.js b/tests/baselines/reference/FunctionDeclaration13_es6.js deleted file mode 100644 index 4c82b0375697c..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration13_es6.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [FunctionDeclaration13_es6.ts] -function * foo() { - // Legal to use 'yield' in a type context. - var v: yield; -} - - -//// [FunctionDeclaration13_es6.js] -function foo() { - // Legal to use 'yield' in a type context. - var v; -} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt new file mode 100644 index 0000000000000..8d995aaf6ca22 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ==== + function * foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.js b/tests/baselines/reference/FunctionDeclaration1_es6.js deleted file mode 100644 index 262c7ea02fbb1..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration1_es6.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [FunctionDeclaration1_es6.ts] -function * foo() { -} - -//// [FunctionDeclaration1_es6.js] -function foo() { -} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.types b/tests/baselines/reference/FunctionDeclaration1_es6.types deleted file mode 100644 index 69b26e5dd1007..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration1_es6.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts === -function * foo() { ->foo : () => void -} diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt index 7d5eb768be697..63e4a929ad901 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,1): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'. -==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ==== function*foo(a = yield) { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. ~~~~~ !!! error TS2304: Cannot find name 'yield'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.js b/tests/baselines/reference/FunctionDeclaration6_es6.js deleted file mode 100644 index 07b3ff52212a0..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration6_es6.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [FunctionDeclaration6_es6.ts] -function*foo(a = yield) { -} - -//// [FunctionDeclaration6_es6.js] -function foo(a) { - if (a === void 0) { a = yield; } -} diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt index 95ad904bdd99f..8f19103435024 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -1,8 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,1): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'. -==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (2 errors) ==== function*bar() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { ~~~~~ diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.js b/tests/baselines/reference/FunctionDeclaration7_es6.js deleted file mode 100644 index 661e1668e0ff2..0000000000000 --- a/tests/baselines/reference/FunctionDeclaration7_es6.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [FunctionDeclaration7_es6.ts] -function*bar() { - // 'yield' here is an identifier, and not a yield expression. - function*foo(a = yield) { - } -} - -//// [FunctionDeclaration7_es6.js] -function bar() { - // 'yield' here is an identifier, and not a yield expression. - function foo(a) { - if (a === void 0) { a = yield; } - } -} diff --git a/tests/baselines/reference/FunctionExpression1_es6.errors.txt b/tests/baselines/reference/FunctionExpression1_es6.errors.txt new file mode 100644 index 0000000000000..3d50ca090b0a4 --- /dev/null +++ b/tests/baselines/reference/FunctionExpression1_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,9): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ==== + var v = function * () { } + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression1_es6.js b/tests/baselines/reference/FunctionExpression1_es6.js deleted file mode 100644 index 7c8d82f4ca82f..0000000000000 --- a/tests/baselines/reference/FunctionExpression1_es6.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [FunctionExpression1_es6.ts] -var v = function * () { } - -//// [FunctionExpression1_es6.js] -var v = function () { -}; diff --git a/tests/baselines/reference/FunctionExpression1_es6.types b/tests/baselines/reference/FunctionExpression1_es6.types deleted file mode 100644 index c857d53baba40..0000000000000 --- a/tests/baselines/reference/FunctionExpression1_es6.types +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts === -var v = function * () { } ->v : () => void ->function * () { } : () => void - diff --git a/tests/baselines/reference/FunctionExpression2_es6.errors.txt b/tests/baselines/reference/FunctionExpression2_es6.errors.txt new file mode 100644 index 0000000000000..1fa7e2e2a739e --- /dev/null +++ b/tests/baselines/reference/FunctionExpression2_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,9): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ==== + var v = function * foo() { } + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression2_es6.js b/tests/baselines/reference/FunctionExpression2_es6.js deleted file mode 100644 index 0a2468bcb8cd2..0000000000000 --- a/tests/baselines/reference/FunctionExpression2_es6.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [FunctionExpression2_es6.ts] -var v = function * foo() { } - -//// [FunctionExpression2_es6.js] -var v = function foo() { -}; diff --git a/tests/baselines/reference/FunctionExpression2_es6.types b/tests/baselines/reference/FunctionExpression2_es6.types deleted file mode 100644 index 7bd9f0904356d..0000000000000 --- a/tests/baselines/reference/FunctionExpression2_es6.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts === -var v = function * foo() { } ->v : () => void ->function * foo() { } : () => void ->foo : () => void - diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt new file mode 100644 index 0000000000000..53b2a01631787 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ==== + var v = { *foo() { } } + ~ +!!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js deleted file mode 100644 index a451dcfb3632d..0000000000000 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [FunctionPropertyAssignments1_es6.ts] -var v = { *foo() { } } - -//// [FunctionPropertyAssignments1_es6.js] -var v = { foo: function () { -} }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types deleted file mode 100644 index 2dfbf5cb6575a..0000000000000 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts === -var v = { *foo() { } } ->v : { foo: () => void; } ->{ *foo() { } } : { foo: () => void; } ->foo : () => void ->*foo() { } : () => void - diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt new file mode 100644 index 0000000000000..f50934ea705d9 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ==== + class C { + *foo() { } + ~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js deleted file mode 100644 index 86e7c9d418a8a..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [MemberFunctionDeclaration1_es6.ts] -class C { - *foo() { } -} - -//// [MemberFunctionDeclaration1_es6.js] -var C = (function () { - function C() { - } - C.prototype.foo = function () { - }; - return C; -})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types deleted file mode 100644 index 265d3fdb29135..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts === -class C { ->C : C - - *foo() { } ->foo : () => void -} diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt new file mode 100644 index 0000000000000..73c065f6a92eb --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,4): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ==== + class C { + public * foo() { } + ~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js deleted file mode 100644 index efd60844dc7fe..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [MemberFunctionDeclaration2_es6.ts] -class C { - public * foo() { } -} - -//// [MemberFunctionDeclaration2_es6.js] -var C = (function () { - function C() { - } - C.prototype.foo = function () { - }; - return C; -})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types deleted file mode 100644 index e1e3f9d17e53d..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts === -class C { ->C : C - - public * foo() { } ->foo : () => void -} diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt new file mode 100644 index 0000000000000..40afaf5bc651a --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ==== + class C { + *foo() { } + ~ +!!! error TS9001: 'generators' are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js deleted file mode 100644 index 211713c6e14a2..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [MemberFunctionDeclaration7_es6.ts] -class C { - *foo() { } -} - -//// [MemberFunctionDeclaration7_es6.js] -var C = (function () { - function C() { - } - C.prototype.foo = function () { - }; - return C; -})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types deleted file mode 100644 index e4c864b9422ad..0000000000000 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts === -class C { ->C : C - - *foo() { } ->foo : () => void ->T : T -} diff --git a/tests/baselines/reference/YieldExpression10_es6.errors.txt b/tests/baselines/reference/YieldExpression10_es6.errors.txt new file mode 100644 index 0000000000000..e2e52a0c5be13 --- /dev/null +++ b/tests/baselines/reference/YieldExpression10_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (1 errors) ==== + var v = { * foo() { + ~ +!!! error TS9001: 'generators' are not currently supported. + yield(foo); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js deleted file mode 100644 index f111e6e1bdf39..0000000000000 --- a/tests/baselines/reference/YieldExpression10_es6.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [YieldExpression10_es6.ts] -var v = { * foo() { - yield(foo); - } -} - - -//// [YieldExpression10_es6.js] -var v = { foo: function () { - ; -} }; diff --git a/tests/baselines/reference/YieldExpression10_es6.types b/tests/baselines/reference/YieldExpression10_es6.types deleted file mode 100644 index e0d3f84c6c865..0000000000000 --- a/tests/baselines/reference/YieldExpression10_es6.types +++ /dev/null @@ -1,11 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts === -var v = { * foo() { ->v : { foo: () => void; } ->{ * foo() { yield(foo); }} : { foo: () => void; } ->foo : () => void ->* foo() { yield(foo); } : () => void - - yield(foo); - } -} - diff --git a/tests/baselines/reference/YieldExpression11_es6.errors.txt b/tests/baselines/reference/YieldExpression11_es6.errors.txt new file mode 100644 index 0000000000000..534d8b17bf22a --- /dev/null +++ b/tests/baselines/reference/YieldExpression11_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (1 errors) ==== + class C { + *foo() { + ~ +!!! error TS9001: 'generators' are not currently supported. + yield(foo); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression11_es6.js b/tests/baselines/reference/YieldExpression11_es6.js deleted file mode 100644 index 306cef3051e6c..0000000000000 --- a/tests/baselines/reference/YieldExpression11_es6.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [YieldExpression11_es6.ts] -class C { - *foo() { - yield(foo); - } -} - -//// [YieldExpression11_es6.js] -var C = (function () { - function C() { - } - C.prototype.foo = function () { - ; - }; - return C; -})(); diff --git a/tests/baselines/reference/YieldExpression11_es6.types b/tests/baselines/reference/YieldExpression11_es6.types deleted file mode 100644 index cdb70b3af0dbb..0000000000000 --- a/tests/baselines/reference/YieldExpression11_es6.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts === -class C { ->C : C - - *foo() { ->foo : () => void - - yield(foo); - } -} diff --git a/tests/baselines/reference/YieldExpression13_es6.errors.txt b/tests/baselines/reference/YieldExpression13_es6.errors.txt new file mode 100644 index 0000000000000..56a0e385cd077 --- /dev/null +++ b/tests/baselines/reference/YieldExpression13_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ==== + function* foo() { yield } + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js deleted file mode 100644 index 328fc80dbdd0f..0000000000000 --- a/tests/baselines/reference/YieldExpression13_es6.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [YieldExpression13_es6.ts] -function* foo() { yield } - -//// [YieldExpression13_es6.js] -function foo() { - ; -} diff --git a/tests/baselines/reference/YieldExpression13_es6.types b/tests/baselines/reference/YieldExpression13_es6.types deleted file mode 100644 index 23a9fe6299a88..0000000000000 --- a/tests/baselines/reference/YieldExpression13_es6.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts === -function* foo() { yield } ->foo : () => void - diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt index e5a9b93eecea8..4a01a92d29030 100644 --- a/tests/baselines/reference/YieldExpression16_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration. +tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,1): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ==== function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. function bar() { yield foo; - ~~~~~ -!!! error TS1163: 'yield' expression must be contained_within a generator declaration. } } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression19_es6.errors.txt b/tests/baselines/reference/YieldExpression19_es6.errors.txt new file mode 100644 index 0000000000000..cce934f568725 --- /dev/null +++ b/tests/baselines/reference/YieldExpression19_es6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (1 errors) ==== + function*foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + function bar() { + function* quux() { + yield(foo); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression19_es6.js b/tests/baselines/reference/YieldExpression19_es6.js deleted file mode 100644 index 91643e09b0ed4..0000000000000 --- a/tests/baselines/reference/YieldExpression19_es6.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [YieldExpression19_es6.ts] -function*foo() { - function bar() { - function* quux() { - yield(foo); - } - } -} - -//// [YieldExpression19_es6.js] -function foo() { - function bar() { - function quux() { - ; - } - } -} diff --git a/tests/baselines/reference/YieldExpression19_es6.types b/tests/baselines/reference/YieldExpression19_es6.types deleted file mode 100644 index a8af884c98f1d..0000000000000 --- a/tests/baselines/reference/YieldExpression19_es6.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts === -function*foo() { ->foo : () => void - - function bar() { ->bar : () => void - - function* quux() { ->quux : () => void - - yield(foo); - } - } -} diff --git a/tests/baselines/reference/YieldExpression3_es6.errors.txt b/tests/baselines/reference/YieldExpression3_es6.errors.txt new file mode 100644 index 0000000000000..577816f3d7cf5 --- /dev/null +++ b/tests/baselines/reference/YieldExpression3_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ==== + function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + yield + yield + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression3_es6.js b/tests/baselines/reference/YieldExpression3_es6.js deleted file mode 100644 index cc3716587eae7..0000000000000 --- a/tests/baselines/reference/YieldExpression3_es6.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [YieldExpression3_es6.ts] -function* foo() { - yield - yield -} - -//// [YieldExpression3_es6.js] -function foo() { - ; - ; -} diff --git a/tests/baselines/reference/YieldExpression3_es6.types b/tests/baselines/reference/YieldExpression3_es6.types deleted file mode 100644 index f9ad4faffdb07..0000000000000 --- a/tests/baselines/reference/YieldExpression3_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts === -function* foo() { ->foo : () => void - - yield - yield -} diff --git a/tests/baselines/reference/YieldExpression4_es6.errors.txt b/tests/baselines/reference/YieldExpression4_es6.errors.txt new file mode 100644 index 0000000000000..10ca8eed8b1d6 --- /dev/null +++ b/tests/baselines/reference/YieldExpression4_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ==== + function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + yield; + yield; + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression4_es6.js b/tests/baselines/reference/YieldExpression4_es6.js deleted file mode 100644 index 84b11a03a2ce9..0000000000000 --- a/tests/baselines/reference/YieldExpression4_es6.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [YieldExpression4_es6.ts] -function* foo() { - yield; - yield; -} - -//// [YieldExpression4_es6.js] -function foo() { - ; - ; -} diff --git a/tests/baselines/reference/YieldExpression4_es6.types b/tests/baselines/reference/YieldExpression4_es6.types deleted file mode 100644 index 083d145d06f18..0000000000000 --- a/tests/baselines/reference/YieldExpression4_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts === -function* foo() { ->foo : () => void - - yield; - yield; -} diff --git a/tests/baselines/reference/YieldExpression6_es6.errors.txt b/tests/baselines/reference/YieldExpression6_es6.errors.txt new file mode 100644 index 0000000000000..7184e36156d03 --- /dev/null +++ b/tests/baselines/reference/YieldExpression6_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (1 errors) ==== + function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + yield*foo + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression6_es6.js b/tests/baselines/reference/YieldExpression6_es6.js deleted file mode 100644 index 5024e9bbd4015..0000000000000 --- a/tests/baselines/reference/YieldExpression6_es6.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [YieldExpression6_es6.ts] -function* foo() { - yield*foo -} - -//// [YieldExpression6_es6.js] -function foo() { - ; -} diff --git a/tests/baselines/reference/YieldExpression6_es6.types b/tests/baselines/reference/YieldExpression6_es6.types deleted file mode 100644 index fd410d2c95919..0000000000000 --- a/tests/baselines/reference/YieldExpression6_es6.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts === -function* foo() { ->foo : () => void - - yield*foo -} diff --git a/tests/baselines/reference/YieldExpression7_es6.errors.txt b/tests/baselines/reference/YieldExpression7_es6.errors.txt new file mode 100644 index 0000000000000..28279e24ff826 --- /dev/null +++ b/tests/baselines/reference/YieldExpression7_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ==== + function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + yield foo + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression7_es6.js b/tests/baselines/reference/YieldExpression7_es6.js deleted file mode 100644 index 96ef5af107e19..0000000000000 --- a/tests/baselines/reference/YieldExpression7_es6.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [YieldExpression7_es6.ts] -function* foo() { - yield foo -} - -//// [YieldExpression7_es6.js] -function foo() { - ; -} diff --git a/tests/baselines/reference/YieldExpression7_es6.types b/tests/baselines/reference/YieldExpression7_es6.types deleted file mode 100644 index 17e1a3b2bfb0d..0000000000000 --- a/tests/baselines/reference/YieldExpression7_es6.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts === -function* foo() { ->foo : () => void - - yield foo -} diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt index f4dd30b1a1947..412a4b6f4bde2 100644 --- a/tests/baselines/reference/YieldExpression8_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,1): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. -==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (1 errors) ==== +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (2 errors) ==== yield(foo); ~~~~~ !!! error TS2304: Cannot find name 'yield'. function* foo() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. yield(foo); } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.js b/tests/baselines/reference/YieldExpression8_es6.js deleted file mode 100644 index 190c2cc3da569..0000000000000 --- a/tests/baselines/reference/YieldExpression8_es6.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [YieldExpression8_es6.ts] -yield(foo); -function* foo() { - yield(foo); -} - -//// [YieldExpression8_es6.js] -yield(foo); -function foo() { - ; -} diff --git a/tests/baselines/reference/YieldExpression9_es6.errors.txt b/tests/baselines/reference/YieldExpression9_es6.errors.txt new file mode 100644 index 0000000000000..4d13d02196ad2 --- /dev/null +++ b/tests/baselines/reference/YieldExpression9_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,9): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (1 errors) ==== + var v = function*() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + yield(foo); + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression9_es6.js b/tests/baselines/reference/YieldExpression9_es6.js deleted file mode 100644 index 978e0d455bddc..0000000000000 --- a/tests/baselines/reference/YieldExpression9_es6.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [YieldExpression9_es6.ts] -var v = function*() { - yield(foo); -} - -//// [YieldExpression9_es6.js] -var v = function () { - ; -}; diff --git a/tests/baselines/reference/YieldExpression9_es6.types b/tests/baselines/reference/YieldExpression9_es6.types deleted file mode 100644 index a570d2f09a0a7..0000000000000 --- a/tests/baselines/reference/YieldExpression9_es6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts === -var v = function*() { ->v : () => void ->function*() { yield(foo);} : () => void - - yield(foo); -} diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt new file mode 100644 index 0000000000000..1d48ebff1d071 --- /dev/null +++ b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (1 errors) ==== + function* gen() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + // Once this is supported, the inner expression does not need to be parenthesized. + var x = yield `abc${ x }def`; + } + \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInYieldKeyword.js b/tests/baselines/reference/templateStringInYieldKeyword.js deleted file mode 100644 index 8e98b269cd009..0000000000000 --- a/tests/baselines/reference/templateStringInYieldKeyword.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [templateStringInYieldKeyword.ts] -function* gen() { - // Once this is supported, the inner expression does not need to be parenthesized. - var x = yield `abc${ x }def`; -} - - -//// [templateStringInYieldKeyword.js] -function gen() { - // Once this is supported, the inner expression does not need to be parenthesized. - var x = ; -} diff --git a/tests/baselines/reference/templateStringInYieldKeyword.types b/tests/baselines/reference/templateStringInYieldKeyword.types deleted file mode 100644 index c3d49ddffb743..0000000000000 --- a/tests/baselines/reference/templateStringInYieldKeyword.types +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts === -function* gen() { ->gen : () => void - - // Once this is supported, the inner expression does not need to be parenthesized. - var x = yield `abc${ x }def`; ->x : unknown -} - diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt new file mode 100644 index 0000000000000..f51ff4863d542 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,1): error TS9001: 'generators' are not currently supported. + + +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts (1 errors) ==== + function* gen() { + ~~~~~~~~ +!!! error TS9001: 'generators' are not currently supported. + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; + } + \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js deleted file mode 100644 index 80021ecae2e90..0000000000000 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [templateStringWithEmbeddedYieldKeywordES6.ts] -function* gen() { - // Once this is supported, yield *must* be parenthesized. - var x = `abc${ yield 10 }def`; -} - - -//// [templateStringWithEmbeddedYieldKeywordES6.js] -function gen() { - // Once this is supported, yield *must* be parenthesized. - var x = `abc${}def`; -} diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types deleted file mode 100644 index c55b40148b164..0000000000000 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts === -function* gen() { ->gen : () => void - - // Once this is supported, yield *must* be parenthesized. - var x = `abc${ yield 10 }def`; ->x : string -} - From d37368e39f68daf18b530efbdbc61b92d290fef1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 25 Nov 2014 13:54:26 -0800 Subject: [PATCH 2/2] Report error on asterisk token. --- src/compiler/parser.ts | 80 +++++++++---------- src/compiler/types.ts | 4 +- .../FunctionDeclaration10_es6.errors.txt | 4 +- .../FunctionDeclaration11_es6.errors.txt | 4 +- .../FunctionDeclaration13_es6.errors.txt | 4 +- .../FunctionDeclaration1_es6.errors.txt | 4 +- .../FunctionDeclaration6_es6.errors.txt | 4 +- .../FunctionDeclaration7_es6.errors.txt | 4 +- .../FunctionExpression1_es6.errors.txt | 4 +- .../FunctionExpression2_es6.errors.txt | 4 +- .../MemberFunctionDeclaration2_es6.errors.txt | 4 +- .../YieldExpression13_es6.errors.txt | 4 +- .../YieldExpression16_es6.errors.txt | 4 +- .../YieldExpression19_es6.errors.txt | 4 +- .../reference/YieldExpression3_es6.errors.txt | 4 +- .../reference/YieldExpression4_es6.errors.txt | 4 +- .../reference/YieldExpression6_es6.errors.txt | 4 +- .../reference/YieldExpression7_es6.errors.txt | 4 +- .../reference/YieldExpression8_es6.errors.txt | 4 +- .../reference/YieldExpression9_es6.errors.txt | 4 +- .../templateStringInYieldKeyword.errors.txt | 4 +- ...ringWithEmbeddedYieldKeywordES6.errors.txt | 4 +- 22 files changed, 78 insertions(+), 86 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f0d333ee68e96..4dd85715852c2 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1155,6 +1155,15 @@ module ts { return false; } + function parseOptionalToken(t: SyntaxKind): Node { + if (token === t) { + var node = createNode(t); + nextToken(); + return finishNode(node); + } + return undefined; + } + function canParseSemicolon() { // If there's a real semicolon, then we can always parse it out. if (token === SyntaxKind.SemicolonToken) { @@ -2202,10 +2211,7 @@ module ts { if (!scanner.hasPrecedingLineBreak() && (token === SyntaxKind.AsteriskToken || isStartOfExpression())) { - if (parseOptional(SyntaxKind.AsteriskToken)) { - node.flags = NodeFlags.YieldStar; - } - + node.asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); node.expression = parseAssignmentExpression(); return finishNode(node); } @@ -2255,7 +2261,7 @@ module ts { } else { // If not, we're probably better off bailing out and returning a bogus function expression. - return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /* name */ undefined, sig, createMissingNode()); + return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /*asteriskToken:*/ undefined, /*name:*/ undefined, sig, createMissingNode()); } } @@ -2395,7 +2401,7 @@ module ts { body = parseAssignmentExpression(); } - return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /* name */ undefined, sig, body); + return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /*asteriskToken:*/ undefined, /*name:*/ undefined, sig, body); } function parseConditionalExpression(): Expression { @@ -2731,26 +2737,23 @@ module ts { function parsePropertyAssignment(): Declaration { var nodePos = scanner.getStartPos(); - var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + var asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); var tokenIsIdentifier = isIdentifier(); var nameToken = token; var propertyName = parsePropertyName(); var node: Declaration; - if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + if (asteriskToken || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { node = createNode(SyntaxKind.PropertyAssignment, nodePos); node.name = propertyName; - if (isGenerator) { - node.flags |= NodeFlags.Generator; - } - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ !!asteriskToken); - var body = parseFunctionBlock(isGenerator, /* ignoreMissingOpenBrace */ false); + var body = parseFunctionBlock(!!asteriskToken, /* ignoreMissingOpenBrace */ false); // do not propagate property name as name for function expression // for scenarios like // var x = 1; // var y = { x() { } } // otherwise this will bring y.x into the scope of x which is incorrect - (node).initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); + (node).initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, asteriskToken, undefined, sig, body); return finishNode(node); } @@ -2808,24 +2811,21 @@ module ts { var pos = getNodePos(); parseExpected(SyntaxKind.FunctionKeyword); - var isGenerator = parseOptional(SyntaxKind.AsteriskToken); - var name = isGenerator ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + var asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); + var name = asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ !!asteriskToken); - var body = parseFunctionBlock(/*allowYield:*/ isGenerator, /* ignoreMissingOpenBrace */ false); - return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body, isGenerator ? NodeFlags.Generator : undefined); + var body = parseFunctionBlock(/*allowYield:*/ !!asteriskToken, /* ignoreMissingOpenBrace */ false); + return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, asteriskToken, name, sig, body); } function parseOptionalIdentifier() { return isIdentifier() ? parseIdentifier() : undefined; } - function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node, flags?: NodeFlags): FunctionExpression { + function makeFunctionExpression(kind: SyntaxKind, pos: number, asteriskToken: Node, name: Identifier, sig: ParsedSignature, body: Node): FunctionExpression { var node = createNode(kind, pos); - if (flags) { - node.flags = flags; - } - + node.asteriskToken = asteriskToken; node.name = name; node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; @@ -3292,14 +3292,10 @@ module ts { var node = createNode(SyntaxKind.FunctionDeclaration, fullStart); setModifiers(node, modifiers); parseExpected(SyntaxKind.FunctionKeyword); - var isGenerator = parseOptional(SyntaxKind.AsteriskToken); - if (isGenerator) { - node.flags |= NodeFlags.Generator; - } - + node.asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); node.name = parseIdentifier(); - fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, node); - node.body = parseFunctionBlockOrSemicolon(isGenerator); + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ !!node.asteriskToken, node); + node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken); return finishNode(node); } @@ -3314,11 +3310,7 @@ module ts { function parsePropertyMemberDeclaration(fullStart: number, modifiers: ModifiersArray): Declaration { var flags = modifiers ? modifiers.flags : 0; - var isGenerator = parseOptional(SyntaxKind.AsteriskToken); - if (isGenerator) { - flags |= NodeFlags.Generator; - } - + var asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken); var name = parsePropertyName(); if (parseOptional(SyntaxKind.QuestionToken)) { // Note: this is not legal as per the grammar. But we allow it in the parser and @@ -3326,15 +3318,16 @@ module ts { flags |= NodeFlags.QuestionMark; } - if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + if (asteriskToken || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { var method = createNode(SyntaxKind.Method, fullStart); setModifiers(method, modifiers); if (flags) { method.flags = flags; } + method.asteriskToken = asteriskToken; method.name = name; - fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, method); - method.body = parseFunctionBlockOrSemicolon(isGenerator); + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ !!asteriskToken, method); + method.body = parseFunctionBlockOrSemicolon(!!asteriskToken); return finishNode(method); } else { @@ -4306,9 +4299,9 @@ module ts { checkForGenerator(node); } - function checkForGenerator(node: Node) { - if (node.flags & NodeFlags.Generator) { - return grammarErrorOnFirstToken(node, Diagnostics.generators_are_not_currently_supported); + function checkForGenerator(node: FunctionLikeDeclaration) { + if (node.asteriskToken) { + return grammarErrorOnNode(node.asteriskToken, Diagnostics.generators_are_not_currently_supported); } } @@ -4741,8 +4734,7 @@ module ts { } function checkPropertyAssignment(node: PropertyDeclaration) { - return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional) || - checkForGenerator(node); + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); } function checkForInvalidQuestionMark(node: Declaration, message: DiagnosticMessage) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e1654fed4090c..d88dbfad593d4 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -271,8 +271,6 @@ module ts { Let = 0x00000800, // Variable declaration Const = 0x00001000, // Variable declaration OctalLiteral = 0x00002000, - Generator = 0x00004000, - YieldStar = 0x00008000, Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, @@ -377,6 +375,7 @@ module ts { * FunctionExpression */ export interface FunctionLikeDeclaration extends Declaration, ParsedSignature { + asteriskToken?: Node; body?: Block | Expression; } @@ -442,6 +441,7 @@ module ts { } export interface YieldExpression extends Expression { + asteriskToken?: Node; expression: Expression; } diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt index 4d167fbc3ecb2..8c1585c2ec641 100644 --- a/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ==== function * foo(a = yield => yield) { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt index 2b623b337512b..ae307281b7531 100644 --- a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ==== function * yield() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt index f19e630418898..50b6b15d708bf 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ==== function * foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. // Legal to use 'yield' in a type context. var v: yield; diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt index 8d995aaf6ca22..b2fdfba350a51 100644 --- a/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ==== function * foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt index 63e4a929ad901..657a227822dbc 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ==== function*foo(a = yield) { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. ~~~~~ !!! error TS2304: Cannot find name 'yield'. diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt index 8f19103435024..f81fd628eb756 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'. ==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (2 errors) ==== function*bar() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { diff --git a/tests/baselines/reference/FunctionExpression1_es6.errors.txt b/tests/baselines/reference/FunctionExpression1_es6.errors.txt index 3d50ca090b0a4..10ac33792287a 100644 --- a/tests/baselines/reference/FunctionExpression1_es6.errors.txt +++ b/tests/baselines/reference/FunctionExpression1_es6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,9): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ==== var v = function * () { } - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression2_es6.errors.txt b/tests/baselines/reference/FunctionExpression2_es6.errors.txt index 1fa7e2e2a739e..a95cffcdbeb36 100644 --- a/tests/baselines/reference/FunctionExpression2_es6.errors.txt +++ b/tests/baselines/reference/FunctionExpression2_es6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,9): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ==== var v = function * foo() { } - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt index 73c065f6a92eb..667e0e5e58d7a 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,4): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ==== class C { public * foo() { } - ~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression13_es6.errors.txt b/tests/baselines/reference/YieldExpression13_es6.errors.txt index 56a0e385cd077..1d2cd4e3c250e 100644 --- a/tests/baselines/reference/YieldExpression13_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression13_es6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ==== function* foo() { yield } - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt index 4a01a92d29030..1963539d4a8fe 100644 --- a/tests/baselines/reference/YieldExpression16_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ==== function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. function bar() { yield foo; diff --git a/tests/baselines/reference/YieldExpression19_es6.errors.txt b/tests/baselines/reference/YieldExpression19_es6.errors.txt index cce934f568725..a427ab18f70bf 100644 --- a/tests/baselines/reference/YieldExpression19_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression19_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (1 errors) ==== function*foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. function bar() { function* quux() { diff --git a/tests/baselines/reference/YieldExpression3_es6.errors.txt b/tests/baselines/reference/YieldExpression3_es6.errors.txt index 577816f3d7cf5..9983eefc9a64e 100644 --- a/tests/baselines/reference/YieldExpression3_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression3_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ==== function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield yield diff --git a/tests/baselines/reference/YieldExpression4_es6.errors.txt b/tests/baselines/reference/YieldExpression4_es6.errors.txt index 10ca8eed8b1d6..58d1326ba596e 100644 --- a/tests/baselines/reference/YieldExpression4_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression4_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ==== function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield; yield; diff --git a/tests/baselines/reference/YieldExpression6_es6.errors.txt b/tests/baselines/reference/YieldExpression6_es6.errors.txt index 7184e36156d03..5ef38d249d57f 100644 --- a/tests/baselines/reference/YieldExpression6_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression6_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (1 errors) ==== function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield*foo } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression7_es6.errors.txt b/tests/baselines/reference/YieldExpression7_es6.errors.txt index 28279e24ff826..11914f6fbb430 100644 --- a/tests/baselines/reference/YieldExpression7_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression7_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ==== function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield foo } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt index 412a4b6f4bde2..591c1fade0802 100644 --- a/tests/baselines/reference/YieldExpression8_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: 'generators' are not currently supported. tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. @@ -7,7 +7,7 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error ~~~~~ !!! error TS2304: Cannot find name 'yield'. function* foo() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield(foo); } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression9_es6.errors.txt b/tests/baselines/reference/YieldExpression9_es6.errors.txt index 4d13d02196ad2..108028d22828a 100644 --- a/tests/baselines/reference/YieldExpression9_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression9_es6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,9): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (1 errors) ==== var v = function*() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. yield(foo); } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt index 1d48ebff1d071..b12b552d5f030 100644 --- a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (1 errors) ==== function* gen() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt index f51ff4863d542..5270e79679e63 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,1): error TS9001: 'generators' are not currently supported. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS9001: 'generators' are not currently supported. ==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts (1 errors) ==== function* gen() { - ~~~~~~~~ + ~ !!! error TS9001: 'generators' are not currently supported. // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`;