WebAssembly.LinkError()
constructor creates a new WebAssembly
LinkError
object, which indicates an error during module instantiation (besides
traps
from the start function).
new WebAssembly.LinkError(message, fileName, lineNumber)
message
可选
Human-readable description of the error.
fileName
可选
The name of the file containing the code that caused the exception.
lineNumber
可选
The line number of the code that caused the exception.
The following snippet creates a new
LinkError
instance, and logs its details to the console:
try {
throw new WebAssembly.LinkError('Hello', 'someFile', 10);
} catch (e) {
console.log(e instanceof LinkError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "LinkError"
console.log(e.fileName); // "someFile"
console.log(e.lineNumber); // 10
console.log(e.columnNumber); // 0
console.log(e.stack); // returns the location where the code was run
}
| 规范 |
|---|
|
WebAssembly JavaScript 接口
The definition of 'LinkError' in that specification. |
|
ECMAScript (ECMA-262)
The definition of 'NativeError constructors' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LinkError()
构造函数
|
Chrome 57 | Edge 16 |
Firefox
52
|
IE No | Opera 44 | Safari 11 | WebView Android 57 | Chrome Android 57 |
Firefox Android
52
|
Opera Android 43 | Safari iOS 11 | Samsung Internet Android 7.0 | nodejs 8.0.0 |
完整支持
不支持
见实现注意事项。
WebAssembly
WebAssembly.Module
WebAssembly.Global
WebAssembly.Instance
WebAssembly.Memory
WebAssembly.Table
WebAssembly.CompileError
WebAssembly.LinkError
WebAssembly.RuntimeError
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()