Skip to content

Commit f16edf9

Browse files
authored
Merge pull request #10875 from Microsoft/fix10857
Fix missing asteriskToken for target=es6/module=amd.
2 parents 0451cc3 + c7bb95b commit f16edf9

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

src/compiler/transformers/module/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ namespace ts {
705705
createFunctionDeclaration(
706706
/*decorators*/ undefined,
707707
/*modifiers*/ undefined,
708-
/*asteriskToken*/ undefined,
708+
node.asteriskToken,
709709
name,
710710
/*typeParameters*/ undefined,
711711
node.parameters,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [generatorES6InAMDModule.ts]
2+
export function* foo() {
3+
yield
4+
}
5+
6+
//// [generatorES6InAMDModule.js]
7+
define(["require", "exports"], function (require, exports) {
8+
"use strict";
9+
function* foo() {
10+
yield;
11+
}
12+
exports.foo = foo;
13+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/generatorES6InAMDModule.ts ===
2+
export function* foo() {
3+
>foo : Symbol(foo, Decl(generatorES6InAMDModule.ts, 0, 0))
4+
5+
yield
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
=== tests/cases/compiler/generatorES6InAMDModule.ts ===
2+
export function* foo() {
3+
>foo : () => IterableIterator<any>
4+
5+
yield
6+
>yield : any
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @target: es6
2+
// @module: amd
3+
export function* foo() {
4+
yield
5+
}

0 commit comments

Comments
 (0)