Преглед изворни кода

use Object.assign instead of Object.create

Sebastián Katzer пре 8 година
родитељ
комит
9f5454d5f0
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 2 2
      www/local-notification-core.js
  2. 1 1
      www/local-notification-util.js

+ 2 - 2
www/local-notification-core.js

@@ -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]);
         }
     }
 

+ 1 - 1
www/local-notification-util.js

@@ -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]);
         }