xref: /third_party/node/test/es-module/test-wasm-memory-out-of-bound.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst buffer = fixtures.readSync('out-of-bound.wasm');
81cb0ef41Sopenharmony_ciWebAssembly.instantiate(buffer, {}).then(common.mustCall((results) => {
91cb0ef41Sopenharmony_ci  assert.throws(() => {
101cb0ef41Sopenharmony_ci    results.instance.exports._start();
111cb0ef41Sopenharmony_ci  }, WebAssembly.RuntimeError('memory access out of bounds'));
121cb0ef41Sopenharmony_ci}));
13

Indexes created Thu Nov 07 10:32:03 CST 2024