aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html
diff options
context:
space:
mode:
authorIrvin <irvinfly@gmail.com>2022-02-16 02:14:18 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commitd44f5032d0f53256b2d5aef505d6b593fd3cd158 (patch)
tree4b585f4be9c9a2712664ad10e7acf62c83fff51f /files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html
parentf45e9e070c93ebbd83d488bdd775987a4d75c201 (diff)
downloadtranslated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.tar.gz
translated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.tar.bz2
translated-content-d44f5032d0f53256b2d5aef505d6b593fd3cd158.zip
fix yari h2m dry run errors (zh-CN)
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html b/files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html
index d4b5877590..f2637be5b6 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html
@@ -63,7 +63,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly
<p>下面的示例(请参见GitHub上的<a href="https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/instantiate-streaming.html">Instantiate-streaming.html</a>演示,并查看<a href="https://mdn.github.io/webassembly-examples/js-api-examples/instantiate-streaming.html">在线演示</a>)直接从流式底层源传输.wasm模块,然后对其进行编译和实例化,并通过<code>ResultObject</code>实现promise。 由于<code>instantiateStreaming()</code>函数接受对 {{domxref("Response")}} 对象的promise,因此您可以直接向其传递{{domxref("WindowOrWorkerGlobalScope.fetch()")}}调用,然后它将把返回的response传递给随后的函数。</p>
-<pre class="brush: js line-numbers language-js">var importObject = { imports: { imported_func: arg =&gt; console.log(arg) } };
+<pre class="brush: js">var importObject = { imports: { imported_func: arg =&gt; console.log(arg) } };
WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject)
.then(obj =&gt; obj.instance.exports.exported_func())</pre>