Closed rwaldron closed 7 years ago
Also, GeneratorFunction
- now it causes problems for polyfilling.
Also AsyncFunction (and eventually AsyncGeneratorFunction).
My personal feeling is they should be attached to the appropriate types even if the types aren't available. but they probably need a way to access them on Function as well.
If at all possible, I would very much like to avoid exposing additional things that should not or cannot be used directly by users. Having Generator
as an exposed type would inevitably lead to someone asking if new Generator()
is possible, and if not, why not. If we can hang methods such as isGeneratorObject()
and isGeneratorFunction()
off something that already exists, even if it's not a completely ideal location, then I'd see that as being far more desirable.
@jasnell thanks for the response, I think that's a reasonable argument.
This leads to the obvious question: should
Generator
be exposed globally? https://tc39.github.io/ecma262/#sec-generator-objects(I'm not saying it should, I'm just opening this for discussion)