summaryrefslogtreecommitdiff
path: root/ext/web/00_infra.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-02-07 13:54:32 +0100
committerGitHub <noreply@github.com>2022-02-07 13:54:32 +0100
commitbf22f114a6e049744866ebaba48faec2cb86549b (patch)
treeea6814e51bade2355144546f21178f54811a57f2 /ext/web/00_infra.js
parent9c7ed1c98b75c3557ac9e269212dcf655f69c0a2 (diff)
refactor: update runtime code for primordial check for iterators (#13510)
Diffstat (limited to 'ext/web/00_infra.js')
-rw-r--r--ext/web/00_infra.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/ext/web/00_infra.js b/ext/web/00_infra.js
index 40595be76..a250dd69b 100644
--- a/ext/web/00_infra.js
+++ b/ext/web/00_infra.js
@@ -18,6 +18,7 @@
StringPrototypePadStart,
TypeError,
ArrayPrototypeJoin,
+ SafeArrayIterator,
StringPrototypeCharAt,
StringPrototypeMatch,
StringPrototypeSlice,
@@ -31,11 +32,21 @@
const ASCII_DIGIT = ["\u0030-\u0039"];
const ASCII_UPPER_ALPHA = ["\u0041-\u005A"];
const ASCII_LOWER_ALPHA = ["\u0061-\u007A"];
- const ASCII_ALPHA = [...ASCII_UPPER_ALPHA, ...ASCII_LOWER_ALPHA];
- const ASCII_ALPHANUMERIC = [...ASCII_DIGIT, ...ASCII_ALPHA];
+ const ASCII_ALPHA = [
+ ...new SafeArrayIterator(ASCII_UPPER_ALPHA),
+ ...new SafeArrayIterator(ASCII_LOWER_ALPHA),
+ ];
+ const ASCII_ALPHANUMERIC = [
+ ...new SafeArrayIterator(ASCII_DIGIT),
+ ...new SafeArrayIterator(ASCII_ALPHA),
+ ];
const HTTP_TAB_OR_SPACE = ["\u0009", "\u0020"];
- const HTTP_WHITESPACE = ["\u000A", "\u000D", ...HTTP_TAB_OR_SPACE];
+ const HTTP_WHITESPACE = [
+ "\u000A",
+ "\u000D",
+ ...new SafeArrayIterator(HTTP_TAB_OR_SPACE),
+ ];
const HTTP_TOKEN_CODE_POINT = [
"\u0021",
@@ -53,7 +64,7 @@
"\u0060",
"\u007C",
"\u007E",
- ...ASCII_ALPHANUMERIC,
+ ...new SafeArrayIterator(ASCII_ALPHANUMERIC),
];
const HTTP_TOKEN_CODE_POINT_RE = new RegExp(
`^[${regexMatcher(HTTP_TOKEN_CODE_POINT)}]+$`,