/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v26.2.0
test/es-module/test-wasm-simple.js
17 строк
472 B
Antoine du Hamel
test: enforce better never-settling-promise detection
11 дек 2025, 02:55
Не верифицирован
11 дек 2025, 02:55
e50cbc1
Код
Авторство
О чём код?
'use strict'; const common = require('../common'); const assert = require('assert'); const fixtures = require('../common/fixtures'); const buffer = fixtures.readSync('simple.wasm'); assert.ok(WebAssembly.validate(buffer), 'Buffer should be valid WebAssembly'); WebAssembly.instantiate(buffer, {}).then((results) => { // Exported function should add two numbers. assert.strictEqual( results.instance.exports.add(10, 20), 30 ); }).then(common.mustCall());