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