11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst buffer = fixtures.readSync('simple.wasm'); 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ciassert.ok(WebAssembly.validate(buffer), 'Buffer should be valid WebAssembly'); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciWebAssembly.instantiate(buffer, {}).then((results) => { 121cb0ef41Sopenharmony_ci // Exported function should add two numbers. 131cb0ef41Sopenharmony_ci assert.strictEqual( 141cb0ef41Sopenharmony_ci results.instance.exports.add(10, 20), 151cb0ef41Sopenharmony_ci 30 161cb0ef41Sopenharmony_ci ); 171cb0ef41Sopenharmony_ci}); 18