summaryrefslogtreecommitdiffstats
path: root/vendor/wasm-bindgen/tests/wasm/owned.js
blob: e1d5dfbe1a5675997dd2b2d376348006b45f8b53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const wasm = require("wasm-bindgen-test.js");

exports.create_garbage = async function () {
  for (let i = 0; i < 100; i++) {
    new wasm.OwnedValue(1).add(new wasm.OwnedValue(2)).n();
  }

  if ("gc" in global) {
    global.gc();
  } else {
    console.warn("test runner doesn't expose GC function");
  }
};