Skip to content

Commit

Permalink
4.10.0 dist
Browse files Browse the repository at this point in the history
  • Loading branch information
fergaldoyle committed Sep 10, 2018
1 parent 35bacff commit 6f8afce
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
39 changes: 35 additions & 4 deletions dist/vue-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ var vueFormParentForm = 'VueFormProviderParentForm' + randomId();

var hasOwn = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var defineProperty$1 = Object.defineProperty;
var gOPD = Object.getOwnPropertyDescriptor;

var isArray = function isArray(arr) {
if (typeof Array.isArray === 'function') {
Expand Down Expand Up @@ -366,6 +368,35 @@ var isPlainObject = function isPlainObject(obj) {
return typeof key === 'undefined' || hasOwn.call(obj, key);
};

// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
var setProperty = function setProperty(target, options) {
if (defineProperty$1 && options.name === '__proto__') {
defineProperty$1(target, options.name, {
enumerable: true,
configurable: true,
value: options.newValue,
writable: true
});
} else {
target[options.name] = options.newValue;
}
};

// Return undefined instead of __proto__ if '__proto__' is not an own property
var getProperty = function getProperty(obj, name) {
if (name === '__proto__') {
if (!hasOwn.call(obj, name)) {
return void 0;
} else if (gOPD) {
// In early versions of node, obj['__proto__'] is buggy when obj has
// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
return gOPD(obj, name).value;
}
}

return obj[name];
};

var extend = function extend() {
var options, name, src, copy, copyIsArray, clone;
var target = arguments[0];
Expand All @@ -390,8 +421,8 @@ var extend = function extend() {
if (options != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
src = getProperty(target, name);
copy = getProperty(options, name);

// Prevent never-ending loop
if (target !== copy) {
Expand All @@ -405,11 +436,11 @@ var extend = function extend() {
}

// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
setProperty(target, { name: name, newValue: extend(deep, clone, copy) });

// Don't bring in undefined values
} else if (typeof copy !== 'undefined') {
target[name] = copy;
setProperty(target, { name: name, newValue: copy });
}
}
}
Expand Down
Loading

0 comments on commit 6f8afce

Please sign in to comment.