From 37b125e7fa284b3afe0c6e78d42dd4ae3869040a Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Sun, 24 Sep 2017 16:56:34 +0800 Subject: [PATCH] fix: variable scope --- docs/async.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/async.md b/docs/async.md index 0954698..65cb443 100644 --- a/docs/async.md +++ b/docs/async.md @@ -505,8 +505,9 @@ function spawn(genF) { return new Promise(function(resolve, reject) { const gen = genF(); function step(nextF) { + let next; try { - var next = nextF(); + next = nextF(); } catch(e) { return reject(e); }