From e50dbfab7d4a559812024cbb60cf19b75face472 Mon Sep 17 00:00:00 2001 From: Jake Fried Date: Thu, 6 May 2021 13:44:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20=20runtime:=20allow=20for=20iter?= =?UTF-8?q?ator=20polyfill=20(#34249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * runtime: allow for iterator polyfill * Empty commit * lint! --- .eslintrc.js | 2 -- build-system/.eslintrc.js | 1 - .../eslint-rules/no-for-of-statement.js | 24 ------------------- examples/.eslintrc.js | 1 - src/service/owners-impl.js | 4 ++-- 5 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 build-system/eslint-rules/no-for-of-statement.js diff --git a/.eslintrc.js b/.eslintrc.js index 2ccf88faa6774..3edd8cbc0f0e7 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 446deafd6d4be..6286a7eca6cb0 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 e1ed87e5b46b5..0000000000000 --- 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 d8603a370912c..83f2de14a4c38 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 5490d8d7bb72b..35d8835be1372 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); - }); + } } /**