Fix global leaks detected by mocha

Fix globals leaked in stringUtils, isJson and static/nav.html.
This commit is contained in:
Hornwitser committed 2019-08-24 11:02:50 +02:00
1 parent 0a9ddef120
commit 0d4ad2f075
3 files changed
+3 -4

No files matched your search

+1 -2
View File
@@ -3,8 +3,7 @@ function hashCode(string){
var hash = 0;
if (string.length == 0) return hash;
for (let i = 0; i < string.length; i++) {
char = string.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = ((hash << 5) - hash) + string.charCodeAt(i);
hash = hash & hash; // Convert to 32bit integer
}
return hash;