diff --git a/.eslintrc.js b/.eslintrc.js index 2ccf88faa677..3edd8cbc0f0e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -143,7 +143,6 @@ module.exports = { 'local/no-dynamic-import': 2, 'local/no-es2015-number-props': 2, 'local/no-export-side-effect': 2, - 'local/no-for-of-statement': 2, 'local/no-forbidden-terms': [ 2, forbiddenTermsGlobal, @@ -276,7 +275,6 @@ module.exports = { 'local/always-call-chai-methods': 2, 'local/no-bigint': 0, 'local/no-dynamic-import': 0, - 'local/no-for-of-statement': 0, 'local/no-function-async': 0, 'local/no-function-generator': 0, 'local/no-import-meta': 0, diff --git a/build-system/.eslintrc.js b/build-system/.eslintrc.js index 446deafd6d4b..6286a7eca6cb 100644 --- a/build-system/.eslintrc.js +++ b/build-system/.eslintrc.js @@ -39,7 +39,6 @@ module.exports = { 'local/no-bigint': 0, 'local/no-dynamic-import': 0, 'local/no-export-side-effect': 0, - 'local/no-for-of-statement': 0, 'local/no-function-async': 0, 'local/no-function-generator': 0, 'local/no-has-own-property-method': 0, diff --git a/build-system/eslint-rules/no-for-of-statement.js b/build-system/eslint-rules/no-for-of-statement.js deleted file mode 100644 index e1ed87e5b46b..000000000000 --- a/build-system/eslint-rules/no-for-of-statement.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright 2016 The AMP HTML Authors. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS-IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -'use strict'; - -module.exports = function (context) { - return { - ForOfStatement: function (node) { - context.report({node, message: 'No for-of statement allowed.'}); - }, - }; -}; diff --git a/examples/.eslintrc.js b/examples/.eslintrc.js index d8603a370912..83f2de14a4c3 100644 --- a/examples/.eslintrc.js +++ b/examples/.eslintrc.js @@ -30,7 +30,6 @@ module.exports = { 'local/no-dynamic-import': 0, 'local/no-es2015-number-props': 0, 'local/no-export-side-effect': 0, - 'local/no-for-of-statement': 0, 'local/no-forbidden-terms': 0, 'local/no-function-async': 0, 'local/no-function-generator': 0, diff --git a/src/service/owners-impl.js b/src/service/owners-impl.js index 5490d8d7bb72..35d8835be137 100644 --- a/src/service/owners-impl.js +++ b/src/service/owners-impl.js @@ -114,10 +114,10 @@ export class OwnersImpl { * @private */ findResourcesInElements_(parentResource, elements, callback) { - elements.forEach((element) => { + for (const element of elements) { devAssert(parentResource.element.contains(element)); this.discoverResourcesForElement_(element, callback); - }); + } } /**