@@ -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 codes : {
4650 ERR_ARG_NOT_ITERABLE ,
@@ -82,7 +86,6 @@ const {
8286 domainToASCII : _domainToASCII ,
8387 domainToUnicode : _domainToUnicode ,
8488 encodeAuth,
85- toUSVString : _toUSVString ,
8689 parse,
8790 setURLConstructor,
8891 URL_FLAGS_CANNOT_BE_BASE ,
@@ -139,18 +142,6 @@ const IteratorPrototype = ObjectGetPrototypeOf(
139142 ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
140143) ;
141144
142- const unpairedSurrogateRe =
143- / (?: [ ^ \uD800 - \uDBFF ] | ^ ) [ \uDC00 - \uDFFF ] | [ \uD800 - \uDBFF ] (? ! [ \uDC00 - \uDFFF ] ) / ;
144- function toUSVString ( val ) {
145- const str = `${ val } ` ;
146- // As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are
147- // slower than `unpairedSurrogateRe.exec()`.
148- const match = RegExpPrototypeExec ( unpairedSurrogateRe , str ) ;
149- if ( ! match )
150- return str ;
151- return _toUSVString ( str , match . index ) ;
152- }
153-
154145// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque
155146const kOpaqueOrigin = 'null' ;
156147
0 commit comments