Herby Vojčík před 4 roky
rodič
revize
6c4e54c495
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      lib/read.js

+ 3 - 2
lib/read.js

@@ -40,8 +40,9 @@ function* eachFormElementInTree (form) {
         for (let value of form[tag]) {
             let shouldCancel = false;
             const cancel = () => shouldCancel = true;
-            yield {tag, value, cancel};
-            if (DIVE_TAGS[tag] && !shouldCancel) yield* eachFormElementInTree(value);
+            const dive = () => eachFormElementInTree(value);
+            yield {tag, value, cancel, dive};
+            if (DIVE_TAGS[tag] && !shouldCancel) yield* dive();
         }
     }
 }