@@ -19,7 +19,6 @@ const {
19
19
ReflectApply,
20
20
ReflectGetOwnPropertyDescriptor,
21
21
ReflectOwnKeys,
22
- RegExpPrototypeExec,
23
22
String,
24
23
StringPrototypeCharCodeAt,
25
24
StringPrototypeIncludes,
@@ -40,7 +39,12 @@ const {
40
39
isHexTable
41
40
} = require ( 'internal/querystring' ) ;
42
41
43
- const { getConstructorOf, removeColors } = require ( 'internal/util' ) ;
42
+ const {
43
+ getConstructorOf,
44
+ removeColors,
45
+ toUSVString,
46
+ } = require ( 'internal/util' ) ;
47
+
44
48
const {
45
49
codes : {
46
50
ERR_ARG_NOT_ITERABLE ,
@@ -82,7 +86,6 @@ const {
82
86
domainToASCII : _domainToASCII ,
83
87
domainToUnicode : _domainToUnicode ,
84
88
encodeAuth,
85
- toUSVString : _toUSVString ,
86
89
parse,
87
90
setURLConstructor,
88
91
URL_FLAGS_CANNOT_BE_BASE ,
@@ -139,18 +142,6 @@ const IteratorPrototype = ObjectGetPrototypeOf(
139
142
ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
140
143
) ;
141
144
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
-
154
145
// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque
155
146
const kOpaqueOrigin = 'null' ;
156
147
0 commit comments