这篇翻译不完整。请帮忙从英语翻译这篇文章。
The legacy generator function is a SpiderMonkey-specific feature, and will be removed at some point. For future-facing usages, consider using
function*
.The legacy generator function statement declares legacy generator functions with the specified parameters.
You can also define functions using the Function
constructor with functionBody
and at least one yield
expression, and a legacy generator function expression.
Syntax语法
function name([param,[, param,[..., param]]]) { [statements] }
name
- 函数名。
param
- 传入函数的参数名,一个函数最多有255个参数。
statements
- The statements which comprise the body of the function. This should contain at least one
yield
expression.
Description描述
An overview of the usage is available on the Iterators and Generators page.
Browser compatibility浏览器兼容性
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 未实现 | (Yes) | 未实现 | 未实现 | 未实现 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 未实现 | 未实现 | (Yes) | 未实现 | 未实现 | 未实现 |