From c131f74db295d454021a1c486873112ad4588ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 10 Jan 2024 14:07:44 +0100 Subject: [PATCH] lib,test: handle new Iterator global Refs: https://github.com/v8/v8/commit/80fb7673eb2ddd2494edf6a491b943e574743d2c --- lib/.eslintrc.yaml | 2 ++ test/common/globals.js | 1 + test/parallel/test-repl-tab-complete.js | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 93ad0a986786b7..072ad66006ffbc 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -65,6 +65,8 @@ rules: # disabled with --without-intl build flag. - name: Intl message: Use `const { Intl } = globalThis;` instead of the global. + - name: Iterator + message: Use `const { Iterator } = globalThis;` instead of the global. - name: MessageChannel message: Use `const { MessageChannel } = require('internal/worker/io');` instead of the global. - name: MessageEvent diff --git a/test/common/globals.js b/test/common/globals.js index 8b9b6b34f6abaf..7b5643a926d970 100644 --- a/test/common/globals.js +++ b/test/common/globals.js @@ -63,6 +63,7 @@ const intrinsics = new Set([ 'SharedArrayBuffer', 'Atomics', 'WebAssembly', + 'Iterator', ]); if (global.gc) { diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 06a55414d5beb5..6784b28032c81a 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -632,6 +632,7 @@ const builtins = [ 'Int32Array', 'Int8Array', ...(common.hasIntl ? ['Intl'] : []), + 'Iterator', 'inspector', 'isFinite', 'isNaN',