@@ -19,7 +19,6 @@ const {
1919 ReflectApply,
2020 ReflectGetOwnPropertyDescriptor,
2121 ReflectOwnKeys,
22- RegExpPrototypeExec,
2322 String,
2423 StringPrototypeCharCodeAt,
2524 StringPrototypeIncludes,
@@ -40,7 +39,12 @@ const {
4039 isHexTable
4140} = require ( 'internal/querystring' ) ;
4241
43- const { getConstructorOf, removeColors } = require ( 'internal/util' ) ;
42+ const {
43+ getConstructorOf,
44+ removeColors,
45+ toUSVString,
46+ } = require ( 'internal/util' ) ;
47+
4448const {
4549 ERR_ARG_NOT_ITERABLE ,
4650 ERR_INVALID_ARG_TYPE ,
@@ -76,7 +80,6 @@ const {
7680 domainToASCII : _domainToASCII ,
7781 domainToUnicode : _domainToUnicode ,
7882 encodeAuth,
79- toUSVString : _toUSVString ,
8083 parse,
8184 setURLConstructor,
8285 URL_FLAGS_CANNOT_BE_BASE ,
@@ -110,18 +113,6 @@ const IteratorPrototype = ObjectGetPrototypeOf(
110113 ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
111114) ;
112115
113- const unpairedSurrogateRe =
114- / (?: [ ^ \uD800 - \uDBFF ] | ^ ) [ \uDC00 - \uDFFF ] | [ \uD800 - \uDBFF ] (? ! [ \uDC00 - \uDFFF ] ) / ;
115- function toUSVString ( val ) {
116- const str = `${ val } ` ;
117- // As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are
118- // slower than `unpairedSurrogateRe.exec()`.
119- const match = RegExpPrototypeExec ( unpairedSurrogateRe , str ) ;
120- if ( ! match )
121- return str ;
122- return _toUSVString ( str , match . index ) ;
123- }
124-
125116// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque
126117const kOpaqueOrigin = 'null' ;
127118
0 commit comments