diff options
author | t7yang <t7yang@gmail.com> | 2022-01-10 08:38:07 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | 563ca0a35e98678e2b7d5f154f31f496851e8d60 (patch) | |
tree | 7c99e7e037128217eca2080df671a742076c615b /files/zh-cn/web/javascript/reference/global_objects/webassembly | |
parent | d7b2995cabe8d85a1827aa18bc270bdf739f3d13 (diff) | |
download | translated-content-563ca0a35e98678e2b7d5f154f31f496851e8d60.tar.gz translated-content-563ca0a35e98678e2b7d5f154f31f496851e8d60.tar.bz2 translated-content-563ca0a35e98678e2b7d5f154f31f496851e8d60.zip |
remove code tag inside pre tag for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/webassembly')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/webassembly/index.html | 4 |
1 files changed, 2 insertions, 2 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 87978a0016..5ce3af745f 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,10 +63,10 @@ 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"><code class="language-js">var importObject = { imports: { imported_func: arg => console.log(arg) } }; +<pre class="brush: js line-numbers language-js">var importObject = { imports: { imported_func: arg => console.log(arg) } }; WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject) -.then(obj => obj.instance.exports.exported_func())</code></pre> +.then(obj => obj.instance.exports.exported_func())</pre> <p>返回的<code>ResultObject</code>实例的成员可以被随后访问到,可以调用实例中被导出的方法。</p> |