Added var to properly declare local variables so that they don't pollute the global namespace and risk multi-threading conflicts.
diff --git a/js/security/Witness.js b/js/security/Witness.js
index 2378595..59f4fe1 100644
--- a/js/security/Witness.js
+++ b/js/security/Witness.js
@@ -120,7 +120,7 @@
if (step == 4) {
// Start to decode digest hex string
len = witness[i+1]; // XXX: digest hex should always be 32 bytes
- str = DataUtils.toHex(witness.subarray(i + 2, i + 2 + len));
+ var str = DataUtils.toHex(witness.subarray(i + 2, i + 2 + len));
this.path.digestList.push(str); // digest hex string
//console.log(str);
}