From 8d882408d2d9867539dcb413b1bf9311c2dd771b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 5 Jul 2022 22:57:35 +0300 Subject: [PATCH] cleanup... Signed-off-by: Alex A. Naanou --- generator.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/generator.js b/generator.js index 4f7de4f..fcb4a23 100644 --- a/generator.js +++ b/generator.js @@ -38,11 +38,11 @@ module.STOP = // of each of them. // So, below we will define: // -// GeneratorPrototype +// Generator.prototype // prototype of the generator constructors (i.e. Iter(..) from the // above example) // -// GeneratorPrototype.prototype +// Generator.prototype.prototype // generator instance prototype (i.e. iter for the above code) // // @@ -58,17 +58,10 @@ module.STOP = // //--------------------------------------------------------------------- -var GeneratorPrototype = - (function*(){}).constructor.prototype - var Generator = module.Generator = (function*(){}).constructor - -var AsyncGeneratorPrototype = - (async function*(){}).constructor.prototype - var AsyncGenerator = module.AsyncGenerator = (async function*(){}).constructor @@ -165,12 +158,12 @@ Generator.iter = // NOTE: we need .iter(..) to both return generators if passed an iterable // and genereator constructos if passed a function... -iter.__proto__ = GeneratorPrototype +iter.__proto__ = Generator.prototype //--------------------------------------------------------------------- -// GeneratorPrototype "class" methods... +// Generator.prototype "class" methods... // // the following are effectively the same: // 1) Wrapper @@ -506,8 +499,8 @@ object.Mixin('GeneratorProtoMixin', 'soft', { }) -GeneratorMixin(GeneratorPrototype) -GeneratorProtoMixin(GeneratorPrototype.prototype) +GeneratorMixin(Generator.prototype) +GeneratorProtoMixin(Generator.prototype.prototype) // Extend base iterators... @@ -613,8 +606,8 @@ object.Mixin('AsyncGeneratorProtoMixin', 'soft', { // ... }) -AsyncGeneratorMixin(AsyncGeneratorPrototype) -AsyncGeneratorProtoMixin(AsyncGeneratorPrototype.prototype) +AsyncGeneratorMixin(AsyncGenerator.prototype) +AsyncGeneratorProtoMixin(AsyncGenerator.prototype.prototype)