Skip to content

Commit 4197bd7

Browse files
author
shengyonggen
committed
这大神的代码都没有声明的。。。
1 parent dd1b28e commit 4197bd7

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sdk.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,14 @@ _.encodeDates = function(obj) {
251251
};
252252

253253
_.hashCode = function(str){
254+
if(typeof str !== 'string'){
255+
return 0;
256+
}
254257
var hash = 0;
255-
if (str.length == 0) return hash;
258+
var char = null;
259+
if (str.length == 0) {
260+
return hash;
261+
}
256262
for (var i = 0; i < str.length; i++) {
257263
char = str.charCodeAt(i);
258264
hash = ((hash<<5)-hash)+char;

src/sensorsdata.full.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ sd.initPara = function(para){
122122
, slice = ArrayProto.slice
123123
, toString = ObjProto.toString
124124
, hasOwnProperty = ObjProto.hasOwnProperty
125-
, LIB_VERSION = '1.8.1.3';
125+
, LIB_VERSION = '1.8.1.4';
126126

127127
sd.lib_version = LIB_VERSION;
128128

@@ -369,8 +369,14 @@ _.encodeDates = function(obj) {
369369
};
370370

371371
_.hashCode = function(str){
372+
if(typeof str !== 'string'){
373+
return 0;
374+
}
372375
var hash = 0;
373-
if (str.length == 0) return hash;
376+
var char = null;
377+
if (str.length == 0) {
378+
return hash;
379+
}
374380
for (var i = 0; i < str.length; i++) {
375381
char = str.charCodeAt(i);
376382
hash = ((hash<<5)-hash)+char;

vtrack.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)