You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2018/02/07 03:25:39 UTC

incubator-weex git commit: * [jsfm] stop using ES6 Proxy to require a module

Repository: incubator-weex
Updated Branches:
  refs/heads/master e9bcc4578 -> 8897646cc


* [jsfm] stop using ES6 Proxy to require a module


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8897646c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8897646c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8897646c

Branch: refs/heads/master
Commit: 8897646cc9b415cce37aca287b850d9bf5152359
Parents: e9bcc45
Author: Hanks <zh...@gmail.com>
Authored: Tue Feb 6 21:22:59 2018 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Tue Feb 6 21:22:59 2018 +0800

----------------------------------------------------------------------
 runtime/api/WeexInstance.js | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8897646c/runtime/api/WeexInstance.js
----------------------------------------------------------------------
diff --git a/runtime/api/WeexInstance.js b/runtime/api/WeexInstance.js
index 3bc25e6..6d1607a 100644
--- a/runtime/api/WeexInstance.js
+++ b/runtime/api/WeexInstance.js
@@ -94,20 +94,18 @@ export default class WeexInstance {
       }
 
       // create module Proxy
-      if (typeof Proxy === 'function') {
-        moduleProxies[proxyName] = new Proxy(moduleApis, {
-          get (target, methodName) {
-            if (methodName in target) {
-              return target[methodName]
-            }
-            console.warn(`[JS Framework] using unregistered method "${moduleName}.${methodName}"`)
-            return moduleGetter(id, moduleName, methodName)
-          }
-        })
-      }
-      else {
-        moduleProxies[proxyName] = moduleApis
-      }
+      // if (typeof Proxy === 'function') {
+      //   moduleProxies[proxyName] = new Proxy(moduleApis, {
+      //     get (target, methodName) {
+      //       if (methodName in target) {
+      //         return target[methodName]
+      //       }
+      //       console.warn(`[JS Framework] using unregistered method "${moduleName}.${methodName}"`)
+      //       return moduleGetter(id, moduleName, methodName)
+      //     }
+      //   })
+      // }
+      moduleProxies[proxyName] = moduleApis
     }
 
     return moduleProxies[proxyName]