From f98b8d7894fc0cd249b1fa834159ffcdb49e13a9 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Sun, 24 May 2020 11:49:51 +0300 Subject: [PATCH] Clean some warnings * 'msg' was used before it was defined. * Missing semicolon. --- wasm/www_bench/index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/wasm/www_bench/index.js b/wasm/www_bench/index.js index 62e69a6..fbe637f 100644 --- a/wasm/www_bench/index.js +++ b/wasm/www_bench/index.js @@ -1,6 +1,13 @@ import * as jpw from "jsonpath-wasm"; import * as jp from "jsonpath/jsonpath.js"; +function msg(msg) { + console.log(msg); + let div = document.createElement("div"); + div.innerText = msg; + document.body.appendChild(div); +} + function run(message, iter, cb) { return new Promise(function(resolve, _reject) { let d = Date.now(); @@ -9,14 +16,7 @@ function run(message, iter, cb) { } msg([message, Date.now() - d].join(", ")); setTimeout(resolve, 0); - }) -} - -function msg(msg) { - console.log(msg); - let div = document.createElement("div"); - div.innerText = msg; - document.body.appendChild(div); + }); } let json = { @@ -65,12 +65,12 @@ let iterCount = 2000; run('jsonpath', iterCount, function() { jp.query(json, path) }) .then(function() { - return run('jsonpath-wasm- selector', iterCount, function() { selector(path) }); + return run('jsonpath-wasm- selector', iterCount, function() { selector(path); }); }) .then(function() { - return run('jsonpath-wasm- compile', iterCount, function() { template(json) }); + return run('jsonpath-wasm- compile', iterCount, function() { template(json); }); }) .then(function() { - return run('jsonpath-wasm- select', iterCount, function() { jpw.select(json, path) }); + return run('jsonpath-wasm- select', iterCount, function() { jpw.select(json, path); }); }) .finally(function() {});