You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/08/17 03:59:46 UTC
[29/43] incubator-weex git commit: * [jsfm] add type check in the
method of TaskCenter
* [jsfm] add type check in the method of TaskCenter
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/65c1af51
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/65c1af51
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/65c1af51
Branch: refs/heads/0.16-dev
Commit: 65c1af51e7ce144119220ca04ee719e99059baf6
Parents: 500cfe8
Author: Hanks <zh...@gmail.com>
Authored: Thu Aug 10 20:06:15 2017 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Thu Aug 10 20:06:15 2017 +0800
----------------------------------------------------------------------
html5/runtime/bridge/TaskCenter.js | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/65c1af51/html5/runtime/bridge/TaskCenter.js
----------------------------------------------------------------------
diff --git a/html5/runtime/bridge/TaskCenter.js b/html5/runtime/bridge/TaskCenter.js
index fd4f5ee..497feab 100644
--- a/html5/runtime/bridge/TaskCenter.js
+++ b/html5/runtime/bridge/TaskCenter.js
@@ -53,19 +53,15 @@ export class TaskCenter {
*/
normalize (v) {
const type = typof(v)
-
- if (v instanceof Element) {
+ if (v && v instanceof Element) {
return v.ref
}
-
- if (v._isVue && v.$el instanceof Element) {
+ if (v && v._isVue && v.$el instanceof Element) {
return v.$el.ref
}
-
if (type === 'Function') {
return this.callbackManager.add(v).toString()
}
-
return normalizePrimitive(v)
}