@@ -307,9 +307,21 @@ const {
307307 WeakSet,
308308} = primordials ;
309309
310- // Because these functions are used by `makeSafe`, which is exposed
311- // on the `primordials` object, it's important to use const references
312- // to the primordials that they use:
310+
311+ /**
312+ * Creates a class that can be safely iterated over.
313+ *
314+ * Because these functions are used by `makeSafe`, which is exposed on the
315+ * `primordials` object, it's important to use const references to the
316+ * primordials that they use.
317+ *
318+ * @template {Iterable} T
319+ * @template {*} TReturn
320+ * @template {*} TNext
321+ * @param {(self: T) => IterableIterator<T> } factory
322+ * @param {(...args: [] | [TNext]) => IteratorResult<T, TReturn> } next
323+ * @returns {Iterator<T, TReturn, TNext> }
324+ */
313325const createSafeIterator = ( factory , next ) => {
314326 class SafeIterator {
315327 constructor ( iterable ) {
@@ -617,6 +629,10 @@ class RegExpLikeForStringSplitting {
617629}
618630ObjectSetPrototypeOf ( RegExpLikeForStringSplitting . prototype , null ) ;
619631
632+ /**
633+ * @param {RegExp } pattern
634+ * @returns {RegExp }
635+ */
620636primordials . hardenRegExp = function hardenRegExp ( pattern ) {
621637 ObjectDefineProperties ( pattern , {
622638 [ SymbolMatch ] : {
@@ -706,6 +722,11 @@ primordials.hardenRegExp = function hardenRegExp(pattern) {
706722} ;
707723
708724
725+ /**
726+ * @param {string } str
727+ * @param {RegExp } regexp
728+ * @returns {number }
729+ */
709730primordials . SafeStringPrototypeSearch = ( str , regexp ) => {
710731 regexp . lastIndex = 0 ;
711732 const match = RegExpPrototypeExec ( regexp , str ) ;
0 commit comments