From d9e9adb5f80a819fe46349bcf6d1faec734b09cd Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:07:31 +0800 Subject: remove span tag in zh-CN --- .../web/javascript/reference/global_objects/generator/index.html | 6 +++--- .../javascript/reference/global_objects/generator/throw/index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/generator') diff --git a/files/zh-cn/web/javascript/reference/global_objects/generator/index.html b/files/zh-cn/web/javascript/reference/global_objects/generator/index.html index 612024ca88..f7e4fc037b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/generator/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/generator/index.html @@ -65,13 +65,13 @@ console.log(gen.next().value);
Generator.prototype.next() {{non-standard_inline}}
-
返回 {{jsxref("Operators/yield", "yield")}} 表达式产生的值. 与ES2015 生成器对象的next()方法对应.
+
返回 {{jsxref("Operators/yield", "yield")}} 表达式产生的值. 与ES2015 生成器对象的next()方法对应.
Generator.prototype.close() {{non-standard_inline}}
-
关闭生成器,因此执行该函数后调用next()函数时将会抛出 {{jsxref("StopIteration")}} 错误. 与ES2015 生成器对象的return()方法对应..
+
关闭生成器,因此执行该函数后调用next()函数时将会抛出 {{jsxref("StopIteration")}} 错误. 与ES2015 生成器对象的return()方法对应..
Generator.prototype.send() {{non-standard_inline}}
用于将值发送到生成器。 该值由 {{jsxref("Operators/yield", "yield")}} 表达式返回, 并且返回下一个 {{jsxref("Operators/yield", "yield")}} 表达式产生的值. send(x) 对应于ES2015生成器对象中的 next(x)
Generator.prototype.throw() {{non-standard_inline}}
-
向生成器抛出错误. 与ES2015 生成器对象的throw()方法对应.
+
向生成器抛出错误. 与ES2015 生成器对象的throw()方法对应.

旧生成器对象示例

diff --git a/files/zh-cn/web/javascript/reference/global_objects/generator/throw/index.html b/files/zh-cn/web/javascript/reference/global_objects/generator/throw/index.html index 13138d5484..fec5b2f93c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/generator/throw/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/generator/throw/index.html @@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Generator/throw

使用 throw()

-

下面的例子展示了一个简单的生成器并使用 throw方法向该生成器抛出一个异常,该异常通常可以通过 try...catch 块进行捕获.

+

下面的例子展示了一个简单的生成器并使用 throw方法向该生成器抛出一个异常,该异常通常可以通过 try...catch 块进行捕获.

function* gen() {
   while(true) {
-- 
cgit v1.2.3-54-g00ecf