X-Git-Url: https://git.ladys.computer/Pisces/blobdiff_plain/0752ef49a10befbfc3c3cb5aa0c194ad5dddef8a..83f6aae0d1b8181dc2b0c6ccdba9f2fe2fdba3e6:/iri.js?ds=inline diff --git a/iri.js b/iri.js index 47b1fb8..5dd9dd0 100644 --- a/iri.js +++ b/iri.js @@ -1,7 +1,7 @@ // ♓🌟 Piscēs ∷ iri.js // ==================================================================== // -// Copyright © 2020, 2022 Lady [@ Lady’s Computer]. +// Copyright © 2020, 2022–2023 Lady [@ Lady’s Computer]. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -20,6 +20,7 @@ import { stringStartsWith, substring, } from "./string.js"; +import { ITERATOR } from "./value.js"; const sub·delims = rawString`[!\$&'()*+,;=]`; const gen·delims = rawString`[:/?#\[\]@]`; @@ -198,24 +199,23 @@ export const { removeDotSegments, } = (() => { const TE = TextEncoder; - const { iterator: iteratorSymbol } = Symbol; const { toString: numberToString } = Number.prototype; const { encode: teEncode } = TE.prototype; - const { [iteratorSymbol]: arrayIterator } = Array.prototype; + const { [ITERATOR]: arrayIterator } = Array.prototype; const { next: arrayIteratorNext, - } = Object.getPrototypeOf([][iteratorSymbol]()); + } = Object.getPrototypeOf([][ITERATOR]()); const { next: generatorIteratorNext, } = Object.getPrototypeOf(function* () {}.prototype); - const { [iteratorSymbol]: stringIterator } = String.prototype; + const { [ITERATOR]: stringIterator } = String.prototype; const { next: stringIteratorNext, - } = Object.getPrototypeOf(""[iteratorSymbol]()); + } = Object.getPrototypeOf(""[ITERATOR]()); const iriCharacterIterablePrototype = { - [iteratorSymbol]() { + [ITERATOR]() { return { next: bind( stringIteratorNext, @@ -226,14 +226,14 @@ export const { }, }; const iriGeneratorIterablePrototype = { - [iteratorSymbol]() { + [ITERATOR]() { return { next: bind(generatorIteratorNext, this.generator(), []), }; }, }; const iriSegmentIterablePrototype = { - [iteratorSymbol]() { + [ITERATOR]() { return { next: bind( arrayIteratorNext,