[ 
https://issues.apache.org/jira/browse/WEEX-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16523924#comment-16523924
 ] 

ASF GitHub Bot commented on WEEX-445:
-------------------------------------

Github user Hanks10100 commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/1254#discussion_r198207371
  
    --- Diff: runtime/api/init.js ---
    @@ -117,6 +117,7 @@ function createInstanceContext (id, options = {}, data) 
{
       Object.assign(runtimeContext, services, {
         weex,
         getJSFMVersion,
    +    requireModule: weex.requireModule,
    --- End diff --
    
    I think using `(..args) => weex.requireModule(...args)` is more reliable. 
We should not assume that the context of `requireModule` has bind to `weex` 
even if it actually does.


> export requireModule to global
> ------------------------------
>
>                 Key: WEEX-445
>                 URL: https://issues.apache.org/jira/browse/WEEX-445
>             Project: Weex
>          Issue Type: New Feature
>          Components: JSFM
>            Reporter: Zhenfei You
>            Assignee: Hanks Zhang
>            Priority: Major
>
> Export requireModule to global, so we can use
> {code:javascript}
> var navigator = requireModule('navigator')
> {code}
> it is equal to 
> {code:javascript}
> var navigator = weex.requireModule('navigator')
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to