grow()
prototype method of the
WebAssembly.Table
object increases the size of the Table instance by a specified number of elements.
table.grow(number);
The number of elements you want to grow the table by.
The previous length of the table.
若
grow()
operation fails for whatever reason, a
RangeError
is thrown.
The following example creates a new WebAssembly Table instance with an initial size of 2 and a maximum size of 10.
var table = new WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 });
You can then grow the table by 1 with the following:
console.log(table.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3"
| 规范 |
|---|
|
WebAssembly JavaScript 接口
The definition of 'grow()' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
grow
|
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()