[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/WebAssembly/Reference/JavaScript_interface/Table/Table [Back]  [Original]

WebAssembly.Table() - WebAssembly | MDN

MDN Web Docs

View in English Always switch to English

WebAssembly.Table()

Baseline

201710

WebAssembly.Table() Table

js
new WebAssembly.Table(tableDescriptor);

tableDescriptor

element

"anyfunc" ()

initial

WebAssembly

maximum

WebAssembly

WebAssembly Table

(table2.html ) WebAssembly 2 2 (Table.prototype.get() ) 2 2 null

js
var tbl = new WebAssembly.Table({ initial: 2, element: "anyfunc" });
console.log(tbl.length); // "2"
console.log(tbl.get(0)); // "null"
console.log(tbl.get(1)); // "null"

js
var importObj = {
  js: {
    tbl: tbl,
  },
};

wasm (table2.wasm) WebAssembly.instantiateStreaming() table2.wasm 2 (1 42 1 83 ) 0 1 () 2 WebAssembly JS

js
WebAssembly.instantiateStreaming(fetch("table2.wasm"), importObject).then(
  function (obj) {
    console.log(tbl.length);
    console.log(tbl.get(0)());
    console.log(tbl.get(1)());
  },
);

( get(0)() get(0) )

JavaScript wasm

WebAssembly JavaScript Interface
# dom-table-table


Web Proxy Viewer  |  New URL  |  Original Page