Clean some warnings

* 'msg' was used before it was defined.
* Missing semicolon.
This commit is contained in:
Guy Korland 2020-05-24 11:49:51 +03:00 committed by Changseok Han
parent 9d78b6910c
commit f98b8d7894

View File

@ -1,6 +1,13 @@
import * as jpw from "jsonpath-wasm"; import * as jpw from "jsonpath-wasm";
import * as jp from "jsonpath/jsonpath.js"; 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) { function run(message, iter, cb) {
return new Promise(function(resolve, _reject) { return new Promise(function(resolve, _reject) {
let d = Date.now(); let d = Date.now();
@ -9,14 +16,7 @@ function run(message, iter, cb) {
} }
msg([message, Date.now() - d].join(", ")); msg([message, Date.now() - d].join(", "));
setTimeout(resolve, 0); setTimeout(resolve, 0);
}) });
}
function msg(msg) {
console.log(msg);
let div = document.createElement("div");
div.innerText = msg;
document.body.appendChild(div);
} }
let json = { let json = {
@ -65,12 +65,12 @@ let iterCount = 2000;
run('jsonpath', iterCount, function() { jp.query(json, path) }) run('jsonpath', iterCount, function() { jp.query(json, path) })
.then(function() { .then(function() {
return run('jsonpath-wasm- selector', iterCount, function() { selector(path) }); return run('jsonpath-wasm- selector', iterCount, function() { selector(path); });
}) })
.then(function() { .then(function() {
return run('jsonpath-wasm- compile', iterCount, function() { template(json) }); return run('jsonpath-wasm- compile', iterCount, function() { template(json); });
}) })
.then(function() { .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() {}); .finally(function() {});