Commit 9f5454d5 by Sebastián Katzer

use Object.assign instead of Object.create

parent 91c5f793
......@@ -335,14 +335,14 @@ exports.addActionGroup = function (id, actions, callback, scope) {
* @return [ Object ]
*/
exports.getDefaults = function () {
var map = Object.create(this._defaults);
var map = Object.assign({}, this._defaults);
for (var key in map) {
if (Array.isArray(map[key])) {
map[key] = Array.from(map[key]);
} else
if (Object.prototype.isPrototypeOf(map[key])) {
map[key] = Object.create(map[key]);
map[key] = Object.assign({}, map[key]);
}
}
......
......@@ -119,7 +119,7 @@ exports.convertProperties = function (options) {
var parseToInt = function (prop, options) {
if (isNaN(options[prop])) {
console.warn(prop + ' is not a number: ' + options[prop]);
return this.getDefaults()[prop];
return this._defaults[prop];
} else {
return Number(options[prop]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment