mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 12:03:44 -05:00
Report errors for using yield/generators right now.
This commit is contained in:
@@ -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." },
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
@@ -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; }; }
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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.
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [FunctionDeclaration11_es6.ts]
|
||||
function * yield() {
|
||||
}
|
||||
|
||||
//// [FunctionDeclaration11_es6.js]
|
||||
function yield() {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts ===
|
||||
function * yield() {
|
||||
>yield : () => void
|
||||
}
|
||||
@@ -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;
|
||||
~~~~~
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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.
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [FunctionDeclaration1_es6.ts]
|
||||
function * foo() {
|
||||
}
|
||||
|
||||
//// [FunctionDeclaration1_es6.js]
|
||||
function foo() {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts ===
|
||||
function * foo() {
|
||||
>foo : () => void
|
||||
}
|
||||
@@ -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'.
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
//// [FunctionDeclaration6_es6.ts]
|
||||
function*foo(a = yield) {
|
||||
}
|
||||
|
||||
//// [FunctionDeclaration6_es6.js]
|
||||
function foo(a) {
|
||||
if (a === void 0) { a = yield; }
|
||||
}
|
||||
@@ -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) {
|
||||
~~~~~
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [FunctionExpression1_es6.ts]
|
||||
var v = function * () { }
|
||||
|
||||
//// [FunctionExpression1_es6.js]
|
||||
var v = function () {
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts ===
|
||||
var v = function * () { }
|
||||
>v : () => void
|
||||
>function * () { } : () => void
|
||||
|
||||
@@ -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.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [FunctionExpression2_es6.ts]
|
||||
var v = function * foo() { }
|
||||
|
||||
//// [FunctionExpression2_es6.js]
|
||||
var v = function foo() {
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts ===
|
||||
var v = function * foo() { }
|
||||
>v : () => void
|
||||
>function * foo() { } : () => void
|
||||
>foo : () => void
|
||||
|
||||
@@ -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.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [FunctionPropertyAssignments1_es6.ts]
|
||||
var v = { *foo() { } }
|
||||
|
||||
//// [FunctionPropertyAssignments1_es6.js]
|
||||
var v = { foo: function () {
|
||||
} };
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
//// [MemberFunctionDeclaration1_es6.ts]
|
||||
class C {
|
||||
*foo() { }
|
||||
}
|
||||
|
||||
//// [MemberFunctionDeclaration1_es6.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
*foo() { }
|
||||
>foo : () => void
|
||||
}
|
||||
@@ -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.
|
||||
}
|
||||
@@ -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;
|
||||
})();
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
public * foo() { }
|
||||
>foo : () => void
|
||||
}
|
||||
@@ -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<T>() { }
|
||||
~
|
||||
!!! error TS9001: 'generators' are not currently supported.
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
//// [MemberFunctionDeclaration7_es6.ts]
|
||||
class C {
|
||||
*foo<T>() { }
|
||||
}
|
||||
|
||||
//// [MemberFunctionDeclaration7_es6.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
};
|
||||
return C;
|
||||
})();
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
*foo<T>() { }
|
||||
>foo : <T>() => void
|
||||
>T : T
|
||||
}
|
||||
11
tests/baselines/reference/YieldExpression10_es6.errors.txt
Normal file
11
tests/baselines/reference/YieldExpression10_es6.errors.txt
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [YieldExpression10_es6.ts]
|
||||
var v = { * foo() {
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [YieldExpression10_es6.js]
|
||||
var v = { foo: function () {
|
||||
;
|
||||
} };
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
11
tests/baselines/reference/YieldExpression11_es6.errors.txt
Normal file
11
tests/baselines/reference/YieldExpression11_es6.errors.txt
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
})();
|
||||
@@ -1,10 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
*foo() {
|
||||
>foo : () => void
|
||||
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [YieldExpression13_es6.ts]
|
||||
function* foo() { yield }
|
||||
|
||||
//// [YieldExpression13_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts ===
|
||||
function* foo() { yield }
|
||||
>foo : () => void
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
13
tests/baselines/reference/YieldExpression19_es6.errors.txt
Normal file
13
tests/baselines/reference/YieldExpression19_es6.errors.txt
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
//// [YieldExpression19_es6.ts]
|
||||
function*foo() {
|
||||
function bar() {
|
||||
function* quux() {
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// [YieldExpression19_es6.js]
|
||||
function foo() {
|
||||
function bar() {
|
||||
function quux() {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
tests/baselines/reference/YieldExpression3_es6.errors.txt
Normal file
10
tests/baselines/reference/YieldExpression3_es6.errors.txt
Normal file
@@ -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
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [YieldExpression3_es6.ts]
|
||||
function* foo() {
|
||||
yield
|
||||
yield
|
||||
}
|
||||
|
||||
//// [YieldExpression3_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts ===
|
||||
function* foo() {
|
||||
>foo : () => void
|
||||
|
||||
yield
|
||||
yield
|
||||
}
|
||||
10
tests/baselines/reference/YieldExpression4_es6.errors.txt
Normal file
10
tests/baselines/reference/YieldExpression4_es6.errors.txt
Normal file
@@ -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;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [YieldExpression4_es6.ts]
|
||||
function* foo() {
|
||||
yield;
|
||||
yield;
|
||||
}
|
||||
|
||||
//// [YieldExpression4_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts ===
|
||||
function* foo() {
|
||||
>foo : () => void
|
||||
|
||||
yield;
|
||||
yield;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
//// [YieldExpression6_es6.ts]
|
||||
function* foo() {
|
||||
yield*foo
|
||||
}
|
||||
|
||||
//// [YieldExpression6_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts ===
|
||||
function* foo() {
|
||||
>foo : () => void
|
||||
|
||||
yield*foo
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
//// [YieldExpression7_es6.ts]
|
||||
function* foo() {
|
||||
yield foo
|
||||
}
|
||||
|
||||
//// [YieldExpression7_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts ===
|
||||
function* foo() {
|
||||
>foo : () => void
|
||||
|
||||
yield foo
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [YieldExpression8_es6.ts]
|
||||
yield(foo);
|
||||
function* foo() {
|
||||
yield(foo);
|
||||
}
|
||||
|
||||
//// [YieldExpression8_es6.js]
|
||||
yield(foo);
|
||||
function foo() {
|
||||
;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
//// [YieldExpression9_es6.ts]
|
||||
var v = function*() {
|
||||
yield(foo);
|
||||
}
|
||||
|
||||
//// [YieldExpression9_es6.js]
|
||||
var v = function () {
|
||||
;
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts ===
|
||||
var v = function*() {
|
||||
>v : () => void
|
||||
>function*() { yield(foo);} : () => void
|
||||
|
||||
yield(foo);
|
||||
}
|
||||
@@ -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`;
|
||||
}
|
||||
|
||||
@@ -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 = ;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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`;
|
||||
}
|
||||
|
||||
@@ -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`;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user