@dcloudio/uni-quickapp-webview 2.0.2-3061520221228002 → 2.0.2-3061720230112002

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -373,7 +373,7 @@ if (!Promise.prototype.finally) {
373
373
  }
374
374
 
375
375
  function promisify (name, api) {
376
- if (!shouldPromise(name)) {
376
+ if (!shouldPromise(name) || !isFn(api)) {
377
377
  return api
378
378
  }
379
379
  return function promiseApi (options = {}, ...params) {
@@ -560,17 +560,19 @@ function normalizeLocale (locale, messages) {
560
560
 
561
561
  function getLocale$1 () {
562
562
  // 优先使用 $locale
563
- const app = getApp({
564
- allowDefault: true
565
- });
566
- if (app && app.$vm) {
567
- return app.$vm.$locale
563
+ if (isFn(getApp)) {
564
+ const app = getApp({
565
+ allowDefault: true
566
+ });
567
+ if (app && app.$vm) {
568
+ return app.$vm.$locale
569
+ }
568
570
  }
569
571
  return normalizeLocale(qa.getSystemInfoSync().language) || LOCALE_EN
570
572
  }
571
573
 
572
574
  function setLocale$1 (locale) {
573
- const app = getApp();
575
+ const app = isFn(getApp) ? getApp() : false;
574
576
  if (!app) {
575
577
  return false
576
578
  }
@@ -2567,9 +2569,6 @@ if (typeof Proxy !== 'undefined' && "quickapp-webview" !== 'app-plus') {
2567
2569
  if (eventApi[name]) {
2568
2570
  return eventApi[name]
2569
2571
  }
2570
- if (typeof qa[name] !== 'function' && !hasOwn(protocols, name)) {
2571
- return
2572
- }
2573
2572
  return promisify(name, wrapper(name, qa[name]))
2574
2573
  },
2575
2574
  set (target, name, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-quickapp-webview",
3
- "version": "2.0.2-3061520221228002",
3
+ "version": "2.0.2-3061720230112002",
4
4
  "description": "uni-app quickapp-webview",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -17,5 +17,5 @@
17
17
  "name": "quickapp-webview",
18
18
  "title": "快应用(Webview)版"
19
19
  },
20
- "gitHead": "385d4400e9ac643a5cc3296bbb8145e745a9035f"
20
+ "gitHead": "7f96adf373b1ed1c454915aeedf9f02e80ce6cf7"
21
21
  }