Repository: incubator-weex Updated Branches: refs/heads/0.16-dev cf40471e6 -> 1ebd484ed
* [jsfm] support send options in task center Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/18c79244 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/18c79244 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/18c79244 Branch: refs/heads/0.16-dev Commit: 18c79244791fcdee62b4924647ed5c488e18ebde Parents: 9994583 Author: Hanks <zhanghan...@gmail.com> Authored: Wed Jun 21 16:54:50 2017 +0800 Committer: Hanks <zhanghan...@gmail.com> Committed: Wed Jun 21 16:54:50 2017 +0800 ---------------------------------------------------------------------- html5/runtime/task-center.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/18c79244/html5/runtime/task-center.js ---------------------------------------------------------------------- diff --git a/html5/runtime/task-center.js b/html5/runtime/task-center.js index 7fe6096..f103011 100644 --- a/html5/runtime/task-center.js +++ b/html5/runtime/task-center.js @@ -83,8 +83,8 @@ export class TaskCenter { } } - send (type, options, args) { - const { action, component, ref, module, method } = options + send (type, params, args, options) { + const { action, component, ref, module, method } = params args = args.map(arg => this.normalize(arg)) @@ -92,9 +92,9 @@ export class TaskCenter { case 'dom': return this[action](this.instanceId, args) case 'component': - return this.componentHandler(this.instanceId, ref, method, args, { component }) + return this.componentHandler(this.instanceId, ref, method, args, Object.assign({ component }, options)) default: - return this.moduleHandler(this.instanceId, module, method, args, {}) + return this.moduleHandler(this.instanceId, module, method, args, options) } } @@ -102,12 +102,12 @@ export class TaskCenter { return this[action](this.instanceId, args) } - callComponent (ref, method, args) { - return this.componentHandler(this.instanceId, ref, method, args, {}) + callComponent (ref, method, args, options) { + return this.componentHandler(this.instanceId, ref, method, args, options) } - callModule (module, method, args) { - return this.moduleHandler(this.instanceId, module, method, args, {}) + callModule (module, method, args, options) { + return this.moduleHandler(this.instanceId, module, method, args, options) } }