Skip to content

Commit a065331

Browse files
[object Generator]
25.3 Generator Objects http://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects ``` C:\Users> node > GF = function* (){} [Function: GF] > GF.constructor.name 'GeneratorFunction' > G = GF() {} > G + '' '[object Generator]' ```
1 parent aad80ad commit a065331

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/lib/es2015.generator.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
interface GeneratorFunction extends Function { }
1+
interface Generator extends Iterator<any> { }
2+
3+
interface GeneratorFunction {
4+
/**
5+
* Creates a new Generator object.
6+
* @param args A list of arguments the function accepts.
7+
*/
8+
new (...args: any[]): Generator;
9+
(...args: any[]): Generator;
10+
}
211

312
interface GeneratorFunctionConstructor {
413
/**

src/lib/es2015.symbol.wellknown.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ interface Function {
137137
[Symbol.hasInstance](value: any): boolean;
138138
}
139139

140-
interface GeneratorFunction extends Function {
140+
interface GeneratorFunction {
141141
readonly [Symbol.toStringTag]: "GeneratorFunction";
142142
}
143143

0 commit comments

Comments
 (0)