Skip to content
This repository was archived by the owner on Oct 10, 2021. It is now read-only.

Commit dff869c

Browse files
author
Treri
committed
feat: build
1 parent 0db247e commit dff869c

File tree

2 files changed

+96
-4
lines changed

2 files changed

+96
-4
lines changed

dist/vue-ios-alertview.js

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,98 @@ var IosAlertviewDefine = {render: function(){var _vm=this;var _h=_vm.$createElem
239239
}
240240
};
241241

242+
/*
243+
object-assign
244+
(c) Sindre Sorhus
245+
@license MIT
246+
*/
247+
248+
/* eslint-disable no-unused-vars */
249+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
250+
var hasOwnProperty = Object.prototype.hasOwnProperty;
251+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
252+
253+
function toObject(val) {
254+
if (val === null || val === undefined) {
255+
throw new TypeError('Object.assign cannot be called with null or undefined');
256+
}
257+
258+
return Object(val);
259+
}
260+
261+
function shouldUseNative() {
262+
try {
263+
if (!Object.assign) {
264+
return false;
265+
}
266+
267+
// Detect buggy property enumeration order in older V8 versions.
268+
269+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
270+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
271+
test1[5] = 'de';
272+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
273+
return false;
274+
}
275+
276+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
277+
var test2 = {};
278+
for (var i = 0; i < 10; i++) {
279+
test2['_' + String.fromCharCode(i)] = i;
280+
}
281+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
282+
return test2[n];
283+
});
284+
if (order2.join('') !== '0123456789') {
285+
return false;
286+
}
287+
288+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
289+
var test3 = {};
290+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
291+
test3[letter] = letter;
292+
});
293+
if (Object.keys(Object.assign({}, test3)).join('') !==
294+
'abcdefghijklmnopqrst') {
295+
return false;
296+
}
297+
298+
return true;
299+
} catch (err) {
300+
// We don't expect any of the above to throw, but better to be safe.
301+
return false;
302+
}
303+
}
304+
305+
var index = shouldUseNative() ? Object.assign : function (target, source) {
306+
var arguments$1 = arguments;
307+
308+
var from;
309+
var to = toObject(target);
310+
var symbols;
311+
312+
for (var s = 1; s < arguments.length; s++) {
313+
from = Object(arguments$1[s]);
314+
315+
for (var key in from) {
316+
if (hasOwnProperty.call(from, key)) {
317+
to[key] = from[key];
318+
}
319+
}
320+
321+
if (getOwnPropertySymbols) {
322+
symbols = getOwnPropertySymbols(from);
323+
for (var i = 0; i < symbols.length; i++) {
324+
if (propIsEnumerable.call(from, symbols[i])) {
325+
to[symbols[i]] = from[symbols[i]];
326+
}
327+
}
328+
}
329+
}
330+
331+
return to;
332+
};
333+
242334
// 默认选项
243335
var defaults = {
244336
defaultOption: 'title',
@@ -261,17 +353,17 @@ function install(Vue, globalOptions){
261353
var IosAlertViewComponent = Vue.extend(IosAlertviewDefine);
262354

263355
// override defaults
264-
Object.assign(defaults, globalOptions);
356+
index(defaults, globalOptions);
265357

266358
function getPropsData(options){
267359
if ( options === void 0 ) options = {};
268360

269-
var propsData = Object.assign({}, defaults);
361+
var propsData = index({}, defaults);
270362

271363
if (typeof options === 'string') {
272364
propsData[defaults.defaultOption] = options;
273365
} else {
274-
propsData = Object.assign(propsData, options);
366+
propsData = index(propsData, options);
275367
}
276368

277369
return propsData;

dist/vue-ios-alertview.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)