From d37368e39f68daf18b530efbdbc61b92d290fef1 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 25 Nov 2014 13:54:26 -0800 Subject: [PATCH] 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 f0d333ee68..4dd8571585 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 e1654fed40..d88dbfad59 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 4d167fbc3e..8c1585c2ec 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 2b623b3375..ae307281b7 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 f19e630418..50b6b15d70 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 8d995aaf6c..b2fdfba350 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 63e4a929ad..657a227822 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 8f19103435..f81fd628eb 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 3d50ca090b..10ac337922 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 1fa7e2e2a7..a95cffcdbe 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 73c065f6a9..667e0e5e58 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 56a0e385cd..1d2cd4e3c2 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 4a01a92d29..1963539d4a 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 cce934f568..a427ab18f7 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 577816f3d7..9983eefc9a 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 10ca8eed8b..58d1326ba5 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 7184e36156..5ef38d249d 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 28279e24ff..11914f6fbb 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 412a4b6f4b..591c1fade0 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 4d13d02196..108028d228 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 1d48ebff1d..b12b552d5f 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 f51ff4863d..5270e79679 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`;