Skip to content

Commit

Permalink
Use native console.assert instead
Browse files Browse the repository at this point in the history
See browsermt#426 for an explanation
  • Loading branch information
jelmervdl committed Jul 23, 2022
1 parent 1ecf477 commit 779e551
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wasm/node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ async function onRuntimeInitialized() {
options.push_back({qualityScores: false, alignment: false, html: false});

// Size of `input` and `options` has to match.
assert(input.size() === options.size());
console.assert(input.size() === options.size());

// Translate our batch (of 1). Output will be another vector of type
// `std::vector<Response>`.
const output = service.translate(model, input, options);

console.assert(false);

// Number of outputs is number of inputs.
assert(input.size() === output.size());
console.assert(input.size() === output.size());

for (let i = 0; i < output.size(); ++i) {
// Get output from std::vector<Response>.
Expand Down

0 comments on commit 779e551

Please sign in to comment.