* [jsfm] export more reliable sendTask method
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d2393899 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d2393899 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d2393899 Branch: refs/heads/0.16-dev Commit: d239389950e036f052c4ad8da7080ec49dfb1d6a Parents: 80b3eae Author: Hanks <zhanghan...@gmail.com> Authored: Fri Jul 28 13:54:04 2017 +0800 Committer: Hanks <zhanghan...@gmail.com> Committed: Fri Jul 28 13:54:04 2017 +0800 ---------------------------------------------------------------------- html5/runtime/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d2393899/html5/runtime/config.js ---------------------------------------------------------------------- diff --git a/html5/runtime/config.js b/html5/runtime/config.js index 4a8fd58..695aa66 100644 --- a/html5/runtime/config.js +++ b/html5/runtime/config.js @@ -24,7 +24,10 @@ const config = { Document, Element, Comment, Listener, TaskCenter, sendTasks (...args) { - return global.callNative(...args) + if (typeof callNative === 'function') { + return callNative(...args) + } + return (global.callNative || (() => {}))(...args) } }