Herby Vojčík пре 6 година
родитељ
комит
6c4e54c495
1 измењених фајлова са 3 додато и 2 уклоњено
  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();
         }
     }
 }