# Expose AsyncFunction, GeneratorFunction and AsyncGeneratorFunction

**URL:** <https://es.discourse.group/t/expose-asyncfunction-generatorfunction-and-asyncgeneratorfunction/1191>\
**Category:** 💡 Ideas\
**Created:** [February 9, 2022, 4:15pm UTC](https://es.discourse.group/t/expose-asyncfunction-generatorfunction-and-asyncgeneratorfunction/1191 "2022-02-09T16:15:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ginden](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ginden/32/739_2.png) [@Ginden](https://es.discourse.group/u/Ginden)\
**Post date:** [February 9, 2022, 4:15pm UTC](https://es.discourse.group/t/expose-asyncfunction-generatorfunction-and-asyncgeneratorfunction/1191/1 "2022-02-09T16:15:11Z")

</div>

Add following properties on `Function` global object:

- `Function.async` - initial value ` %AsyncFunction%`
- `Function.generator` - initial value ` %GeneratorFunction%`
- `Function.asyncGenerator` - initial value set to ` %AsyncGeneratorFunction%`

These are mildly useful for code generation purposes. These builtins already exist in specification, but it's quite hard to access them.

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [February 9, 2022, 6:24pm UTC](https://es.discourse.group/t/expose-asyncfunction-generatorfunction-and-asyncgeneratorfunction/1191/2 "2022-02-09T18:24:52Z")

</div>

since they're constructors, they'd need to be capitalized (`Function.Async`, `Function.Generator`, etc).

However, unfortunately due to the precedent of `SharedArrayBuffer` not being `ArrayBuffer.Shared`, etc, I suspect that they'd need to be added as three new top-level globals, if they were added at all.

(It would be very helpful to avoid needing syntax to reach these globals; i'd love to see them explicitly available)
