Fix event target type check issue

This commit is contained in:
pandamicro
2018-04-17 10:31:09 +08:00
parent b315831f8f
commit f892d5e677
+2 -2
View File
@@ -239,7 +239,7 @@ proto.hasEventListener = function (type, checkCapture) {
*/
proto.on = function (type, callback, target, useCapture) {
// Accept also patameters like: (type, callback, useCapture)
if (useCapture === undefined) {
if (typeof target === 'boolean') {
useCapture = target;
target = undefined;
}
@@ -296,7 +296,7 @@ proto.on = function (type, callback, target, useCapture) {
*/
proto.off = function (type, callback, target, useCapture) {
// Accept also patameters like: (type, callback, useCapture)
if (useCapture === undefined) {
if (typeof target === 'boolean') {
useCapture = target;
target = undefined;
}