From 855d62b55d70abe9bb0e3ae592a562a5358fcf47 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Tue, 28 Apr 2020 17:56:53 -0400 Subject: [PATCH] standardize context iteration error messages --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index d4a4d2ad2..132f6e5a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -649,7 +649,7 @@ class HostNode extends ParentNode { *[Symbol.iterator]() { while (!this.unmounted) { if (this.iterating) { - throw new Error("You must yield something each iteration over context"); + throw new Error("You must yield for each iteration of this."); } this.iterating = true; @@ -837,7 +837,7 @@ class ComponentNode extends ParentNode { *[Symbol.iterator](): Generator { while (!this.unmounted) { if (this.iterating) { - throw new Error("You must yield once per iteration over context"); + throw new Error("You must yield for each iteration of this."); } else if (this.componentType === AsyncGen) { throw new Error("Use for await...of in async generator components."); } @@ -850,7 +850,7 @@ class ComponentNode extends ParentNode { async *[Symbol.asyncIterator](): AsyncGenerator { do { if (this.iterating) { - throw new Error("You must yield once per iteration over context"); + throw new Error("You must yield for each iteration of this."); } else if (this.componentType === SyncGen) { throw new Error("Use for...of in sync generator components."); }