]> Lady’s Gitweb - Pisces/blobdiff - iri.js
Add methods for own entries and values to object.js
[Pisces] / iri.js
diff --git a/iri.js b/iri.js
index 47b1fb83edf81dfa56e4594a8f3e4ae17c5f1c34..5dd9dd098ed778e7e8984e8e20484f0c0f9b6d1d 100644 (file)
--- 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,
This page took 0.119561 seconds and 4 git commands to generate.