[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]'
```
This commit is contained in:
IgorNovozhilov 2017-03-25 17:26:18 +03:00
parent aad80ad138
commit a065331d69
2 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,13 @@
interface GeneratorFunction extends Function { }
interface Generator extends Iterator<any> { }
interface GeneratorFunction {
/**
* Creates a new Generator object.
* @param args A list of arguments the function accepts.
*/
new (...args: any[]): Generator;
(...args: any[]): Generator;
}
interface GeneratorFunctionConstructor {
/**

View file

@ -137,7 +137,7 @@ interface Function {
[Symbol.hasInstance](value: any): boolean;
}
interface GeneratorFunction extends Function {
interface GeneratorFunction {
readonly [Symbol.toStringTag]: "GeneratorFunction";
}