Skip to content

Commit 30cc359

Browse files
committed
更新
1 parent f856cfb commit 30cc359

14 files changed

+58
-45
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.13.20(2020-03-19)
2+
* 修复:修复点击处理函数参数为 null 时,点击预置事件报错问题;
3+
14
## 1.13.19(2020-03-11)
25
* 新增:新增预置点击事件 $MPClick 可通过配置确定是否采集功能;
36
* 新增:插件版 SDK 支持 Component 构造器构造的页面的预置事件采集功能;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sa-sdk-miniprogram",
3-
"version": "1.13.19",
3+
"version": "1.13.20",
44
"description": "sensorsdata miniprogram sdk",
55
"main": "sensorsdata.min.js",
66
"scripts": {

product/sensorsdata.custom.es6.full.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {

product/sensorsdata.custom.full.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {

product/sensorsdata.es6.full.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {
@@ -1696,7 +1695,7 @@ function click_proxy(option, method) {
16961695
var prop = {},
16971696
type = '';
16981697

1699-
if (typeof arguments[0] === 'object') {
1698+
if (_.isObject(arguments[0])) {
17001699
var target = arguments[0].currentTarget || {};
17011700
var dataset = target.dataset || {};
17021701
type = arguments[0]['type'];
@@ -1920,8 +1919,10 @@ var oldPage = Page;
19201919
Page = function(option) {
19211920
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option);
19221921

1923-
for (var i = 0, len = methods.length; i < len; i++) {
1924-
click_proxy(option, methods[i]);
1922+
if (!!methods) {
1923+
for (var i = 0, len = methods.length; i < len; i++) {
1924+
click_proxy(option, methods[i]);
1925+
}
19251926
}
19261927

19271928
mp_proxy(option, "onLoad", 'pageLoad');
@@ -1937,8 +1938,10 @@ Component = function(option) {
19371938
try {
19381939
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option.methods);
19391940

1940-
for (var i = 0, len = methods.length; i < len; i++) {
1941-
click_proxy(option.methods, methods[i]);
1941+
if (!!methods) {
1942+
for (var i = 0, len = methods.length; i < len; i++) {
1943+
click_proxy(option.methods, methods[i]);
1944+
}
19421945
}
19431946

19441947
mp_proxy(option.methods, 'onLoad', 'pageLoad');

product/sensorsdata.full.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {
@@ -1696,7 +1695,7 @@ function click_proxy(option, method) {
16961695
var prop = {},
16971696
type = '';
16981697

1699-
if (typeof arguments[0] === 'object') {
1698+
if (_.isObject(arguments[0])) {
17001699
var target = arguments[0].currentTarget || {};
17011700
var dataset = target.dataset || {};
17021701
type = arguments[0]['type'];
@@ -1920,8 +1919,10 @@ var oldPage = Page;
19201919
Page = function(option) {
19211920
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option);
19221921

1923-
for (var i = 0, len = methods.length; i < len; i++) {
1924-
click_proxy(option, methods[i]);
1922+
if (!!methods) {
1923+
for (var i = 0, len = methods.length; i < len; i++) {
1924+
click_proxy(option, methods[i]);
1925+
}
19251926
}
19261927

19271928
mp_proxy(option, "onLoad", 'pageLoad');
@@ -1937,8 +1938,10 @@ Component = function(option) {
19371938
try {
19381939
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option.methods);
19391940

1940-
for (var i = 0, len = methods.length; i < len; i++) {
1941-
click_proxy(option.methods, methods[i]);
1941+
if (!!methods) {
1942+
for (var i = 0, len = methods.length; i < len; i++) {
1943+
click_proxy(option.methods, methods[i]);
1944+
}
19421945
}
19431946

19441947
mp_proxy(option.methods, 'onLoad', 'pageLoad');

product/sensorsdata.plugin.es6.full.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {
@@ -1696,7 +1695,7 @@ function click_proxy(option, method) {
16961695
var prop = {},
16971696
type = '';
16981697

1699-
if (typeof arguments[0] === 'object') {
1698+
if (_.isObject(arguments[0])) {
17001699
var target = arguments[0].currentTarget || {};
17011700
var dataset = target.dataset || {};
17021701
type = arguments[0]['type'];
@@ -1917,8 +1916,10 @@ sa.App = function(option) {
19171916
sa.Page = function(option) {
19181917
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option);
19191918

1920-
for (var i = 0, len = methods.length; i < len; i++) {
1921-
click_proxy(option, methods[i]);
1919+
if (!!methods) {
1920+
for (var i = 0, len = methods.length; i < len; i++) {
1921+
click_proxy(option, methods[i]);
1922+
}
19221923
}
19231924
mp_proxy(option, "onLoad", 'pageLoad');
19241925
mp_proxy(option, "onShow", 'pageShow');
@@ -1931,8 +1932,10 @@ sa.Component = function(option) {
19311932
try {
19321933
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option.methods);
19331934

1934-
for (var i = 0, len = methods.length; i < len; i++) {
1935-
click_proxy(option.methods, methods[i]);
1935+
if (!!methods) {
1936+
for (var i = 0, len = methods.length; i < len; i++) {
1937+
click_proxy(option.methods, methods[i]);
1938+
}
19361939
}
19371940

19381941
mp_proxy(option.methods, 'onLoad', 'pageLoad');

product/sensorsdata.plugin.full.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var ArrayProto = Array.prototype,
114114
slice = ArrayProto.slice,
115115
toString = ObjProto.toString,
116116
hasOwnProperty = ObjProto.hasOwnProperty,
117-
LIB_VERSION = '1.13.19',
117+
LIB_VERSION = '1.13.20',
118118
LIB_NAME = 'MiniProgram';
119119

120120
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -265,8 +265,7 @@ sa.lib_version = LIB_VERSION;
265265
_.extend2Lev = function(obj) {
266266
each(slice.call(arguments, 1), function(source) {
267267
for (var prop in source) {
268-
if (source[prop] !==
269-
void 0) {
268+
if (source[prop] !== void 0 && source[prop] !== null) {
270269
if (_.isObject(source[prop]) && _.isObject(obj[prop])) {
271270
_.extend(obj[prop], source[prop]);
272271
} else {
@@ -1696,7 +1695,7 @@ function click_proxy(option, method) {
16961695
var prop = {},
16971696
type = '';
16981697

1699-
if (typeof arguments[0] === 'object') {
1698+
if (_.isObject(arguments[0])) {
17001699
var target = arguments[0].currentTarget || {};
17011700
var dataset = target.dataset || {};
17021701
type = arguments[0]['type'];
@@ -1917,8 +1916,10 @@ sa.App = function(option) {
19171916
sa.Page = function(option) {
19181917
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option);
19191918

1920-
for (var i = 0, len = methods.length; i < len; i++) {
1921-
click_proxy(option, methods[i]);
1919+
if (!!methods) {
1920+
for (var i = 0, len = methods.length; i < len; i++) {
1921+
click_proxy(option, methods[i]);
1922+
}
19221923
}
19231924
mp_proxy(option, "onLoad", 'pageLoad');
19241925
mp_proxy(option, "onShow", 'pageShow');
@@ -1931,8 +1932,10 @@ sa.Component = function(option) {
19311932
try {
19321933
var methods = sa.para.autoTrack && sa.para.autoTrack.mpClick && _.getMethods(option.methods);
19331934

1934-
for (var i = 0, len = methods.length; i < len; i++) {
1935-
click_proxy(option.methods, methods[i]);
1935+
if (!!methods) {
1936+
for (var i = 0, len = methods.length; i < len; i++) {
1937+
click_proxy(option.methods, methods[i]);
1938+
}
19361939
}
19371940

19381941
mp_proxy(option.methods, 'onLoad', 'pageLoad');

sensorsdata.custom.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sensorsdata.custom.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)