diff options
| author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2021-09-07 00:43:07 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-07 00:43:07 +0900 |
| commit | c01e8779a5fed876331e3933e8e19e1daecab11c (patch) | |
| tree | be0fe33e2fd3a86e6b4d77197a0954e9b88456ab /files/ja/web/javascript/reference/global_objects/webassembly/table/grow | |
| parent | f07b200c812378523739b7e1e75b7e6cf72fe673 (diff) | |
| download | translated-content-c01e8779a5fed876331e3933e8e19e1daecab11c.tar.gz translated-content-c01e8779a5fed876331e3933e8e19e1daecab11c.tar.bz2 translated-content-c01e8779a5fed876331e3933e8e19e1daecab11c.zip | |
Global_Objects/WebAssembly/Table 以下の文書を更新 (#2265)
- Markdownに変換
- 2021/08/28 時点の英語版に同期
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/webassembly/table/grow')
| -rw-r--r-- | files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.html | 77 | ||||
| -rw-r--r-- | files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.md | 68 |
2 files changed, 68 insertions, 77 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.html b/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.html deleted file mode 100644 index 3c645810aa..0000000000 --- a/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: WebAssembly.Table.prototype.grow() -slug: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow -tags: - - API - - JavaScript - - Method - - Reference - - WebAssembly - - grow - - table - - メソッド -translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow ---- -<div>{{JSRef}}</div> - -<p><code><strong>grow()</strong></code> は {{jsxref("WebAssembly.Table")}} オブジェクトのプロトタイプメソッドで、指定された要素数でテーブルを拡張します。</p> - -<h2 id="Syntax" name="Syntax">構文</h2> - -<pre class="syntaxbox">table.grow(<em>number</em>); -</pre> - -<h3 id="Parameters" name="Parameters">引数</h3> - -<dl> - <dt><em>number</em></dt> - <dd>テーブルを拡張する要素数。</dd> -</dl> - -<h3 id="Return_value" name="Return_value">返値</h3> - -<p>以前のテーブルの長さ。</p> - -<h3 id="Exceptions" name="Exceptions">例外</h3> - -<p>もし <code>grow()</code> 操作が何かしらの理由で失敗した場合、{{jsxref("RangeError")}} をスローします。</p> - -<h2 id="Examples" name="Examples">例</h2> - -<p>次の例では、初期サイズが2で最大サイズが10の WebAssembly Table を作成しています。</p> - -<pre class="brush: js">var table = new WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 });</pre> - -<p>次のようにすることで、テーブルのサイズを1拡張することができます:</p> - -<pre class="brush: js">console.log(table.length); // "2" -console.log(table.grow(1)); // "2" -console.log(table.length); // "3" -</pre> - -<h2 id="Specifications" name="Specifications">仕様書</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('WebAssembly JS', '#dom-table-grow', 'grow()')}}</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> - -<p>{{Compat("javascript.builtins.WebAssembly.Table.set")}}</p> - -<h2 id="See_also" name="See_also">関連情報</h2> - -<ul> - <li><a href="/ja/docs/WebAssembly">WebAssembly</a> 概要ページ</li> - <li><a href="/ja/docs/WebAssembly/Concepts">WebAssembly の概念</a></li> - <li><a href="/ja/docs/WebAssembly/Using_the_JavaScript_API">WebAssembly JavaScript API の使用</a></li> -</ul> diff --git a/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.md b/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.md new file mode 100644 index 0000000000..3622d9dcaf --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/webassembly/table/grow/index.md @@ -0,0 +1,68 @@ +--- +title: WebAssembly.Table.prototype.grow() +slug: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow +tags: + - API + - JavaScript + - メソッド + - Reference + - WebAssembly + - grow + - table +browser-compat: javascript.builtins.WebAssembly.Table.grow +translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow +--- +{{JSRef}} + +**`grow()`** は {{jsxref("WebAssembly.Table")}} オブジェクトのプロトタイプメソッドで、 Table インスタンスの大きさを指定された要素数だけ拡張します。 + +## 構文 + +```js +grow(number) +``` + +### 引数 + +- _number_ + - : テーブルを拡張する要素数です。 + +### 返値 + +直前のテーブルの長さです。 + +### 例外 + +`grow()` の操作が何らかの理由で失敗した場合、 {{jsxref("RangeError")}} が発生します。 + +## 例 + +### grow の使用 + +以下の例では、新しい WebAssembly Table のインスタンスを初期サイズ 2、最大サイズ 10 で生成しています。 + +```js +var table = new WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 }); +``` + +以下のようにして、テーブルを 1 だけ拡張することができます。 + +```js +console.log(table.length); // "2" +console.log(table.grow(1)); // "2" +console.log(table.length); // "3" +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- [WebAssembly](/ja/docs/WebAssembly) 概要ページ +- [WebAssembly の概念](/ja/docs/WebAssembly/Concepts) +- [WebAssembly JavaScript API の使用](/ja/docs/WebAssembly/Using_the_JavaScript_API) |
