提交 8204b4d9 编写于 作者: D DCloud_LXH

fix(mp): __GLOBAL__ 上读取非方法属性 question/159865

上级 eeb4d051
...@@ -69,7 +69,7 @@ if (!Promise.prototype.finally) { ...@@ -69,7 +69,7 @@ if (!Promise.prototype.finally) {
} }
export function promisify (name, api) { export function promisify (name, api) {
if (!shouldPromise(name)) { if (!shouldPromise(name) || !isFn(api)) {
return api return api
} }
return function promiseApi (options = {}, ...params) { return function promiseApi (options = {}, ...params) {
...@@ -83,4 +83,4 @@ export function promisify (name, api) { ...@@ -83,4 +83,4 @@ export function promisify (name, api) {
}), ...params) }), ...params)
}))) })))
} }
} }
...@@ -67,9 +67,6 @@ if (typeof Proxy !== 'undefined' && __PLATFORM__ !== 'app-plus') { ...@@ -67,9 +67,6 @@ if (typeof Proxy !== 'undefined' && __PLATFORM__ !== 'app-plus') {
if (eventApi[name]) { if (eventApi[name]) {
return eventApi[name] return eventApi[name]
} }
if (typeof __GLOBAL__[name] !== 'function' && !hasOwn(protocols, name)) {
return
}
return promisify(name, wrapper(name, __GLOBAL__[name])) return promisify(name, wrapper(name, __GLOBAL__[name]))
}, },
set (target, name, value) { set (target, name, value) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册