From 7fd4c196b96e6ae1ca8ec22a0ea1b5ce8d31af61 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 7 Aug 2024 15:42:43 -0600 Subject: [PATCH] update wording again --- normative-conventions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/normative-conventions.md b/normative-conventions.md index d9d34f4..eae6781 100644 --- a/normative-conventions.md +++ b/normative-conventions.md @@ -40,7 +40,7 @@ NB: This convention is new as of 2024, and most earlier parts of the language do ## Reject primitives in iterable-taking positions -Any time an iterable or async-iterable value (a value that has a `Symbol.iterator` or `Symbol.asyncIterator` method) is expected, primitives should be treated as if they were not iterable. Usually, this will mean throwing a `TypeError`. Primitive wrapper Objects such as String Objects, however, should be treated like any other Object. +Any time an iterable or async-iterable value (a value that has a `Symbol.iterator` or `Symbol.asyncIterator` method) is expected, primitives should be treated as if they were not iterable. Usually, this will mean throwing a `TypeError`. If the user provides a primitive wrapper Object such as a String Object, however, it should be treated like any other Object. Although primitive Strings are default iterable (`String.prototype` has a `Symbol.iterator` method which enumerates code points), it is now considered a mistake to iterate a String without specifying whether the String is providing an abstraction over code units, code points, grapheme clusters, or something else.