Commit e483eee1 by Sebastián Katzer

use for in instead of for of loops

parent 77b6cffe
...@@ -68,7 +68,8 @@ exports.schedule = function (msgs, callback, scope, args) { ...@@ -68,7 +68,8 @@ exports.schedule = function (msgs, callback, scope, args) {
return; return;
} }
for (var toast of toasts) { for (var i = 0, len = toasts.length; i < len; i++) {
var toast = toasts[i];
this.mergeWithDefaults(toast); this.mergeWithDefaults(toast);
this.convertProperties(toast); this.convertProperties(toast);
} }
...@@ -102,8 +103,8 @@ exports.update = function (msgs, callback, scope, args) { ...@@ -102,8 +103,8 @@ exports.update = function (msgs, callback, scope, args) {
return; return;
} }
for (var toast of toasts) { for (var i = 0, len = toasts.length; i < len; i++) {
this.convertProperties(toast); this.convertProperties(toasts[i]);
} }
this.exec('update', toasts, callback, scope); this.exec('update', toasts, callback, scope);
......
...@@ -173,7 +173,8 @@ exports.convertActions = function (options) { ...@@ -173,7 +173,8 @@ exports.convertActions = function (options) {
if (!options.actions) if (!options.actions)
return null; return null;
for (var action of options.actions) { for (var i = 0, len = options.actions.length; i < len; i++) {
var action = options.actions[i];
if (!action.id) { if (!action.id) {
console.warn('Action with title ' + action.title + ' ' + console.warn('Action with title ' + action.title + ' ' +
...@@ -335,8 +336,8 @@ exports.createCallbackFn = function (fn, scope) { ...@@ -335,8 +336,8 @@ exports.createCallbackFn = function (fn, scope) {
exports.convertIds = function (ids) { exports.convertIds = function (ids) {
var convertedIds = []; var convertedIds = [];
for (var id of ids) { for (var i = 0, len = ids.length; i < len; i++) {
convertedIds.push(Number(id)); convertedIds.push(Number(ids[i]));
} }
return convertedIds; return convertedIds;
...@@ -353,7 +354,7 @@ exports.convertIds = function (ids) { ...@@ -353,7 +354,7 @@ exports.convertIds = function (ids) {
exports.getValueFor = function (options) { exports.getValueFor = function (options) {
var keys = Array.apply(null, arguments).slice(1); var keys = Array.apply(null, arguments).slice(1);
for (var key of keys) { for (var i = 0, key = keys[i], len = keys.length; i < len; key = keys[++i]) {
if (options.hasOwnProperty(key)) { if (options.hasOwnProperty(key)) {
return options[key]; return options[key];
} }
......
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