【发布时间】:2015-12-11 20:06:18
【问题描述】:
我运行这段代码:
function* quips(name) {
yield "hello " + name + "!";
yield "i hope you are enjoying the blog posts";
if (name.toLowerCase().startsWith("x")) {
yield "hey, it's cool how your name starts with an X, " + name;
}
yield "see you later!";
yield* quips(name)
}
var meow_iter = quips("Xingu");
showCat();
并捕获一些 referenceError: regeneratorRuntime is not defined - 我做错了什么?
【问题讨论】:
-
@Louy 抱歉。我只是从这里people.mozilla.org/~jorendorff/demos/meow.html 复制粘贴代码,但在调用
showCat之前发生错误。你可以确定codepen.io/anon/pen/Veveey