@@ -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 ,
@@ -79,7 +83,6 @@ const {
7983 domainToASCII : _domainToASCII ,
8084 domainToUnicode : _domainToUnicode ,
8185 encodeAuth,
82- toUSVString : _toUSVString ,
8386 parse,
8487 setURLConstructor,
8588 URL_FLAGS_CANNOT_BE_BASE ,
@@ -113,18 +116,6 @@ const IteratorPrototype = ObjectGetPrototypeOf(
113116 ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
114117) ;
115118
116- const unpairedSurrogateRe =
117- / (?: [ ^ \uD800 - \uDBFF ] | ^ ) [ \uDC00 - \uDFFF ] | [ \uD800 - \uDBFF ] (? ! [ \uDC00 - \uDFFF ] ) / ;
118- function toUSVString ( val ) {
119- const str = `${ val } ` ;
120- // As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are
121- // slower than `unpairedSurrogateRe.exec()`.
122- const match = RegExpPrototypeExec ( unpairedSurrogateRe , str ) ;
123- if ( ! match )
124- return str ;
125- return _toUSVString ( str , match . index ) ;
126- }
127-
128119// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque
129120const kOpaqueOrigin = 'null' ;
130121
0 commit comments