diff options
Diffstat (limited to 'files/ja/archive/web/javascript/legacy_generator_function/index.html')
| -rw-r--r-- | files/ja/archive/web/javascript/legacy_generator_function/index.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/files/ja/archive/web/javascript/legacy_generator_function/index.html b/files/ja/archive/web/javascript/legacy_generator_function/index.html new file mode 100644 index 0000000000..1603eed239 --- /dev/null +++ b/files/ja/archive/web/javascript/legacy_generator_function/index.html @@ -0,0 +1,56 @@ +--- +title: レガシージェネレータ関数式 +slug: Archive/Web/JavaScript/Legacy_generator_function +tags: + - JavaScript + - Legacy Iterator + - Reference +translation_of: Archive/Web/JavaScript/Legacy_generator_function +--- +<div class="warning">レガシージェネレータ関数式はSpiderMonkey固有の機能で、Firefox 58以降で取り除かれます。将来向きの用途に、{{jsxref("Operators/function*", "function* expression")}}を使用することを検討してください。</div> + +<div>{{jsSidebar("Operators")}}</div> + +<p><strong><code>function</code></strong> キーワードは式内でレガシージェネレータ関数を定義するために使用されます。関数がレガシージェネレータとなるために、関数本体は少なくとも一つの{{jsxref("Operators/yield", "yield")}}式を含む必要があります。</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox">function [<em>name</em>]([<em>param1</em>[, <em>param2[</em>, ..., <em>paramN</em>]]]) { + <em>statements</em> +}</pre> + +<h3 id="引数">引数</h3> + +<dl> + <dt><code>name</code></dt> + <dd>関数名。関数が<em>無名</em>の場合、省略できます。名前は関数本体のみにローカルであります。</dd> + <dt><code>paramN</code></dt> + <dd>関数に渡される引数の名前。関数は最大255の引数を持ち得ます。</dd> + <dt><code>statements</code></dt> + <dd>関数の本体を構成するステートメント。これは少なくとも一つの{{jsxref("Operators/yield", "yield")}}式を含む必要があります。</dd> +</dl> + +<h2 id="説明">説明</h2> + +<p>使用方法の概要が<a href="/docs/JavaScript/Guide/Iterators_and_Generators" title="/docs/JavaScript/Guide/Iterators_and_Generators">Iterators and Generators</a>ページで提供されています。</p> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>Supported nowhere.</p> + +<h2 id="関連情報">関連情報</h2> + +<ul> + <li>{{jsxref("Generator")}}</li> + <li><a href="/docs/Web/JavaScript/Reference/Statements/Legacy_generator_function">The legacy generator function</a></li> + <li><a href="/docs/Web/JavaScript/Guide/The_legacy_Iterator_protocol">The legacy Iterator protocol</a></li> + <li>{{jsxref("Operators/yield", "yield")}}</li> + <li><a href="/docs/Web/JavaScript/Reference/Functions_and_function_scope" title="JavaScript/Reference/Functions_and_function_scope">Functions and function scope</a></li> + <li>{{jsxref("Statements/function", "function")}}</li> + <li>{{jsxref("Operators/function", "function expression")}}</li> + <li>{{jsxref("Function")}}</li> + <li>{{jsxref("Statements/function*", "function*")}}</li> + <li>{{jsxref("Operators/function*", "function* expression")}}</li> + <li>{{jsxref("GeneratorFunction")}}</li> + <li><a href="/docs/Web/JavaScript/Guide/The_Iterator_protocol">The Iterator protocol</a></li> +</ul> |
