From 2bb573b3dbc3b762fc122692db645f6312504e7d Mon Sep 17 00:00:00 2001 From: pandamicro Date: Mon, 9 Oct 2017 15:48:00 +0800 Subject: [PATCH] Use undefined for id validation --- jsb/jsb-etc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsb/jsb-etc.js b/jsb/jsb-etc.js index 692ede1665..225d56346e 100644 --- a/jsb/jsb-etc.js +++ b/jsb/jsb-etc.js @@ -67,7 +67,7 @@ cc.Scheduler.prototype.schedule = function (callback, target, interval, repeat, } delay = delay || 0; var instanceId = target.__instanceId || target.uuid; - cc.assertID(!isNaN(instanceId), 1510); + cc.assertID(instanceId !== undefined, 1510); if (!callback.__callbackId) { callback.__callbackId = _callbackId++; } @@ -83,7 +83,7 @@ cc.Scheduler.prototype.unschedule = function (callback, target) { callback = tmp; } var instanceId = target.__instanceId || target.uuid; - cc.assertID(!isNaN(instanceId) && !isNaN(callback.__callbackId), 1510); + cc.assertID(instanceId !== undefined && callback.__callbackId !== undefined, 1510); var key = instanceId + '_' + callback.__callbackId; this._unschedule(key, target); };