-
Notifications
You must be signed in to change notification settings - Fork 8.2k
zh-cn: add new page for WebAssembly.LinkError #27364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+69
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
files/zh-cn/webassembly/reference/javascript_interface/linkerror/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: WebAssembly.LinkError | ||
slug: WebAssembly/Reference/JavaScript_interface/LinkError | ||
l10n: | ||
sourceCommit: 006c05b688814b45a01ad965bbe4ebfc15513e74 | ||
--- | ||
|
||
**`WebAssembly.LinkError`** 对象表示模块实例化期间的错误(除启动函数中的[陷阱](https://webassembly.github.io/simd/core/intro/overview.html#trap))。 | ||
|
||
## 构造函数 | ||
|
||
- [`WebAssembly.LinkError()`](/zh-CN/docs/WebAssembly/Reference/JavaScript_interface/LinkError/LinkError) | ||
- : 创建一个新的 `WebAssembly.LinkError` 对象。 | ||
|
||
## 实例属性 | ||
|
||
- {{jsxref("Error.prototype.message", "WebAssembly.LinkError.prototype.message")}} | ||
- : 错误消息。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.name", "WebAssembly.LinkError.prototype.name")}} | ||
- : 错误名字。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.cause", "WebAssembly.LinkError.prototype.cause")}} | ||
- : 错误原因。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.fileName", "WebAssembly.LinkError.prototype.fileName")}} {{non-standard_inline}} | ||
- : 引发此错误的文件所在的路径。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.lineNumber", "WebAssembly.LinkError.prototype.lineNumber")}} {{non-standard_inline}} | ||
- : 在引发此错误的文件中的行号。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.columnNumber", "WebAssembly.LinkError.prototype.columnNumber")}} {{non-standard_inline}} | ||
- : 在引发此错误的行中的列号。继承自 {{jsxref("Error")}}。 | ||
- {{jsxref("Error.prototype.stack", "WebAssembly.LinkError.prototype.stack")}} {{non-standard_inline}} | ||
- : 堆栈跟踪。继承自 {{jsxref("Error")}}。 | ||
|
||
## 实例方法 | ||
|
||
- {{jsxref("Error.prototype.toString", "WebAssembly.LinkError.prototype.toString()")}} | ||
- : 返回一个表示指定的 `Error` 对象的字符串。继承自 {{jsxref("Error")}}。 | ||
|
||
## 示例 | ||
|
||
### 创建一个新的 LinkError 实例 | ||
|
||
下面的代码片段创建一个新的 `LinkError` 实例,并将其详情输出到控制台: | ||
|
||
```js | ||
try { | ||
throw new WebAssembly.LinkError("你好", "某个文件", 10); | ||
} catch (e) { | ||
console.log(e instanceof LinkError); // true | ||
console.log(e.message); // "你好" | ||
console.log(e.name); // "LinkError" | ||
console.log(e.fileName); // "某个文件" | ||
console.log(e.lineNumber); // 10 | ||
console.log(e.columnNumber); // 0 | ||
console.log(e.stack); // 返回运行代码的位置 | ||
} | ||
``` | ||
|
||
## 规范 | ||
|
||
{{Specifications}} | ||
|
||
## 浏览器兼容性 | ||
|
||
{{Compat}} | ||
|
||
## 参见 | ||
|
||
- [WebAssembly](/zh-CN/docs/WebAssembly) 概览 | ||
- [WebAssembly 概念](/zh-CN/docs/WebAssembly/Guides/Concepts) | ||
- [使用 WebAssembly JavaScript API](/zh-CN/docs/WebAssembly/Guides/Using_the_JavaScript_API) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.