From 4d302c816978376f12019b6a6902257a30f451cc Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Sat, 9 Oct 2021 11:48:29 +0800 Subject: [PATCH] build(deps): bump vue from 3.2.19 to 3.2.20 --- packages/uni-mp-vue/dist/vue.runtime.esm.js | 60 +++++++++++++++++---- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/packages/uni-mp-vue/dist/vue.runtime.esm.js b/packages/uni-mp-vue/dist/vue.runtime.esm.js index 01f7bc25c..204b276d2 100644 --- a/packages/uni-mp-vue/dist/vue.runtime.esm.js +++ b/packages/uni-mp-vue/dist/vue.runtime.esm.js @@ -4276,15 +4276,21 @@ function getContext() { * only. * @internal */ -function mergeDefaults( -// the base props is compiler-generated and guaranteed to be in this shape. -props, defaults) { +function mergeDefaults(raw, defaults) { + const props = isArray(raw) + ? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {}) + : raw; for (const key in defaults) { - const val = props[key]; - if (val) { - val.default = defaults[key]; + const opt = props[key]; + if (opt) { + if (isArray(opt) || isFunction(opt)) { + props[key] = { type: opt, default: defaults[key] }; + } + else { + opt.default = defaults[key]; + } } - else if (val === null) { + else if (opt === null) { props[key] = { default: defaults[key] }; } else if ((process.env.NODE_ENV !== 'production')) { @@ -4341,7 +4347,7 @@ const useSSRContext = () => { }; // Core API ------------------------------------------------------------------ -const version = "3.2.19"; +const version = "3.2.20"; /** * @internal only exposed in compat builds */ @@ -4818,8 +4824,44 @@ function initOptionMergeStrategies(optionMergeStrategies) { }); } +let realAtob; +const b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; +const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/; +if (typeof atob !== 'function') { + realAtob = function (str) { + str = String(str).replace(/[\t\n\f\r ]+/g, ''); + if (!b64re.test(str)) { + throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."); + } + // Adding the padding if missing, for semplicity + str += '=='.slice(2 - (str.length & 3)); + var bitmap; + var result = ''; + var r1; + var r2; + var i = 0; + for (; i < str.length;) { + bitmap = + (b64.indexOf(str.charAt(i++)) << 18) | + (b64.indexOf(str.charAt(i++)) << 12) | + ((r1 = b64.indexOf(str.charAt(i++))) << 6) | + (r2 = b64.indexOf(str.charAt(i++))); + result += + r1 === 64 + ? String.fromCharCode((bitmap >> 16) & 255) + : r2 === 64 + ? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255) + : String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255); + } + return result; + }; +} +else { + // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法 + realAtob = atob; +} function b64DecodeUnicode(str) { - return decodeURIComponent(atob(str) + return decodeURIComponent(realAtob(str) .split('') .map(function (c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); -- GitLab