diff options
| author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:02:49 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | 01b0e12ba27b5069248fd09235e9a7143915ee30 (patch) | |
| tree | 0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/global_objects/webassembly | |
| parent | 6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff) | |
| download | translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.gz translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.bz2 translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.zip | |
remove `notranslate` class in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/webassembly')
3 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/webassembly/global/index.html b/files/zh-cn/web/javascript/reference/global_objects/webassembly/global/index.html index 3366032120..d8577bae83 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/webassembly/global/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/webassembly/global/index.html @@ -43,7 +43,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Global <p>global的值发生改变, 首先设置<code>Global.value</code> 为42, 然后使用导出函数 <code>incGlobal()</code> 增加为43. 导出函数在 <code>global.wasm</code> 模块中(它将参数的值加一并返回).</p> -<pre class="brush: js notranslate">const output = document.getElementById('output'); +<pre class="brush: js">const output = document.getElementById('output'); function assertEq(msg, got, expected) { output.innerHTML += `Testing ${msg}: `; diff --git a/files/zh-cn/web/javascript/reference/global_objects/webassembly/instance/index.html b/files/zh-cn/web/javascript/reference/global_objects/webassembly/instance/index.html index 44dec6610b..de15cec004 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/webassembly/instance/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/webassembly/instance/index.html @@ -21,7 +21,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance <p><strong>重要</strong>: 由于大型模块的实例化代价极高, 开发人员应只在必须同步实例化的时候,才使用<code>Instance()</code>;绝大多数情况应该使用异步方法{{jsxref("WebAssembly.instantiate()")}} .</p> </div> -<pre class="syntaxbox notranslate">var myInstance = new WebAssembly.Instance(<em>module</em>, <em>importObject</em>);</pre> +<pre class="syntaxbox">var myInstance = new WebAssembly.Instance(<em>module</em>, <em>importObject</em>);</pre> <h3 id="参数">参数</h3> diff --git a/files/zh-cn/web/javascript/reference/global_objects/webassembly/table/index.html b/files/zh-cn/web/javascript/reference/global_objects/webassembly/table/index.html index 9582758e32..9be0f967cd 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/webassembly/table/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/webassembly/table/index.html @@ -15,7 +15,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table <h2 id="语法">语法</h2> -<pre class="syntaxbox notranslate">var myTable = new WebAssembly.Table(tableDescriptor);</pre> +<pre class="syntaxbox">var myTable = new WebAssembly.Table(tableDescriptor);</pre> <h3 id="参数">参数</h3> @@ -68,14 +68,14 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/Table <p>The following example (see table2.html <a href="https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/table2.html">source code</a> and <a href="https://mdn.github.io/webassembly-examples/js-api-examples/table2.html">live version</a>) creates a new WebAssembly Table instance with an initial size of 2 elements. We then print out the table length and contents of the two indexes (retrieved via {{jsxref("WebAssembly/Table/get", "Table.prototype.get()")}} to show that the length is two and both elements are {{jsxref("null")}}.</p> -<pre class="brush: js notranslate">var tbl = new WebAssembly.Table({initial:2, element:"anyfunc"}); +<pre class="brush: js">var tbl = new WebAssembly.Table({initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null"</pre> <p>We then create an import object that contains the table:</p> -<pre class="brush: js notranslate">var importObj = { +<pre class="brush: js">var importObj = { js: { tbl:tbl } @@ -83,7 +83,7 @@ console.log(tbl.get(1)); // "null"</pre> <p>Finally, we load and instantiate a wasm module (table2.wasm) using the {{jsxref("WebAssembly.instantiateStreaming()")}} method. The table2.wasm module contains two functions (one that returns 42 and another that returns 83) and stores both into elements 0 and 1 of the imported table (see <a href="https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/table2.wat">text representation</a>). So after instantiation, the table still has length 2, but the elements now contain callable <a href="/en-US/docs/WebAssembly/Exported_functions">Exported WebAssembly Functions</a> which we can call from JS.</p> -<pre class="brush: js notranslate">WebAssembly.instantiateStreaming(fetch('table2.wasm'), importObject) +<pre class="brush: js">WebAssembly.instantiateStreaming(fetch('table2.wasm'), importObject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); |
