Fix missing asteriskToken for target=es6/module=amd.

Fixes #10857.
This commit is contained in:
rbuckton 2016-09-12 14:22:25 -07:00
parent 1fce34be71
commit c7bb95bb29
5 changed files with 32 additions and 1 deletions

View file

@ -705,7 +705,7 @@ namespace ts {
createFunctionDeclaration(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*asteriskToken*/ undefined,
node.asteriskToken,
name,
/*typeParameters*/ undefined,
node.parameters,

View file

@ -0,0 +1,13 @@
//// [generatorES6InAMDModule.ts]
export function* foo() {
yield
}
//// [generatorES6InAMDModule.js]
define(["require", "exports"], function (require, exports) {
"use strict";
function* foo() {
yield;
}
exports.foo = foo;
});

View file

@ -0,0 +1,6 @@
=== tests/cases/compiler/generatorES6InAMDModule.ts ===
export function* foo() {
>foo : Symbol(foo, Decl(generatorES6InAMDModule.ts, 0, 0))
yield
}

View file

@ -0,0 +1,7 @@
=== tests/cases/compiler/generatorES6InAMDModule.ts ===
export function* foo() {
>foo : () => IterableIterator<any>
yield
>yield : any
}

View file

@ -0,0 +1,5 @@
// @target: es6
// @module: amd
export function* foo() {
yield
}