/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/cases/wasm/table/index.js
32 строки
1 KB
Alexander Akait
Cut Bun test skips down to the few cases Bun genuinely can't run (#21239)
21 июн 2026, 21:58
Не верифицирован
21 июн 2026, 21:58
10f5fcc
Код
Авторство
О чём код?
// the message is inconsistency between engines (V8 wording vs JSC/Bun) const UNKNOWN_FUNCTION_TABLE = /table index is out of bounds|invalid index into function table|invalid function|Out of bounds call_indirect/; it("should support tables", function () { return import("./wasm-table.wat").then(function (wasm) { expect(wasm.callByIndex(0)).toEqual(42); expect(wasm.callByIndex(1)).toEqual(13); expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); }); }); it("should support exported tables", function () { return import("./wasm-table-export.wat").then(function (wasm) { expect(wasm.table).toBeInstanceOf(WebAssembly.Table); expect(wasm.table.length).toBe(2); const e0 = wasm.table.get(0); const e1 = wasm.table.get(1); expect(e0).toBeInstanceOf(Function); expect(e1).toBeInstanceOf(Function); expect(e0()).toEqual(42); expect(e1()).toEqual(13); }); }); it("should support imported tables", function () { return import("./wasm-table-imported.wat").then(function (wasm) { expect(wasm.callByIndex(0)).toEqual(42); expect(wasm.callByIndex(1)).toEqual(13); expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); }); });