Use let instead of var in objects.js

This commit is contained in:
Christoph Diehl 2017-05-02 17:09:14 +03:00
parent b55264b24f
commit 37912b3a3f

View file

@ -45,7 +45,7 @@ Objects.prototype.pick = function (category, last) {
} }
Objects.prototype.pop = function (objectName) { Objects.prototype.pop = function (objectName) {
var self = this let self = this
utils.getKeysFromHash(this.container).forEach(function (category) { utils.getKeysFromHash(this.container).forEach(function (category) {
self.container[category].forEach(function (obj) { self.container[category].forEach(function (obj) {
if (obj.name === objectName) { if (obj.name === objectName) {
@ -56,8 +56,8 @@ Objects.prototype.pop = function (objectName) {
} }
Objects.prototype.contains = function (categoryNames) { Objects.prototype.contains = function (categoryNames) {
var categories = [] let categories = []
var self = this let self = this
categoryNames.forEach(function (name) { categoryNames.forEach(function (name) {
if (self.has(name)) { if (self.has(name)) {
categories.push(name) categories.push(name)
@ -83,13 +83,13 @@ Objects.prototype.has = function (category) {
} }
Objects.prototype.valid = function () { Objects.prototype.valid = function () {
var items = [] let items = []
var self = this let self = this
utils.common.getKeysFromHash(self.container).forEach(function (category) { utils.common.getKeysFromHash(self.container).forEach(function (category) {
self.check(category) self.check(category)
}) })
utils.common.getKeysFromHash(self.container).forEach(function (category) { utils.common.getKeysFromHash(self.container).forEach(function (category) {
for (var i = 0; i < self.container[category].length; i++) { for (let i = 0; i < self.container[category].length; i++) {
items.push(self.container[category][i].name) items.push(self.container[category][i].name)
} }
}) })
@ -97,7 +97,7 @@ Objects.prototype.valid = function () {
} }
Objects.prototype.check = function (category) { Objects.prototype.check = function (category) {
var self = this let self = this
self.container[category].forEach(function (object) { self.container[category].forEach(function (object) {
try { try {
let x = /* frame.contentWindow. */ eval(object.name) // eslint-disable-line no-eval let x = /* frame.contentWindow. */ eval(object.name) // eslint-disable-line no-eval