Two different ways of spec'ing built-in generators. I believe the difference is between them is purely editoral:
-
Copy entire existing 25.4 Generator Objects section of the spec, changing the name to, say,
BuiltinGenerator
Objects that have no prototype and modified abstract operations, so they are observably distinct from generators, while behaving the same. Then make the lazy Iterator Helper methods create and return new objects that contain instances of these internal generators with the proper function bodies.Duplicates a lot of stuff in the spec, but seems pretty straightforward to write and understand.
-
Create some kind of
AbstractGenerator
/AbstractAsyncGenerator
interfaces and move as much of the abstract operations