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();
         }
     }
 }