From d9e9adb5f80a819fe46349bcf6d1faec734b09cd Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:07:31 +0800 Subject: remove span tag in zh-CN --- .../reference/global_objects/webassembly/compileerror/index.html | 2 +- .../web/javascript/reference/global_objects/webassembly/index.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/webassembly') diff --git a/files/zh-cn/web/javascript/reference/global_objects/webassembly/compileerror/index.html b/files/zh-cn/web/javascript/reference/global_objects/webassembly/compileerror/index.html index 179b8589a2..9292349082 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/webassembly/compileerror/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/webassembly/compileerror/index.html @@ -15,7 +15,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError
message {{optional_inline}}
-
有可读性的错误描述。
+
有可读性的错误描述。
fileName {{optional_inline}}{{non-standard_inline}}
包含导致异常的代码的文件名。
lineNumber {{optional_inline}}{{non-standard_inline}}
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 66f14793af..87978a0016 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

下面的示例(请参见GitHub上的Instantiate-streaming.html演示,并查看在线演示)直接从流式底层源传输.wasm模块,然后对其进行编译和实例化,并通过ResultObject实现promise。 由于instantiateStreaming()函数接受对 {{domxref("Response")}} 对象的promise,因此您可以直接向其传递{{domxref("WindowOrWorkerGlobalScope.fetch()")}}调用,然后它将把返回的response传递给随后的函数。

-
var importObject = { imports: { imported_func: arg => console.log(arg) } };
+
var importObject = { imports: { imported_func: arg => console.log(arg) } };
 
-WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject)
-.then(obj => obj.instance.exports.exported_func())
+WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject) +.then(obj => obj.instance.exports.exported_func())

返回的ResultObject实例的成员可以被随后访问到,可以调用实例中被导出的方法。

-- cgit v1.2.3-54-g00ecf