Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[jsfm] Stop using ES6 Proxy to require a module #1017

Merged
merged 1 commit into from
Feb 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions runtime/api/WeexInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down