@@ -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
ERR_ARG_NOT_ITERABLE ,
46
50
ERR_INVALID_ARG_TYPE ,
@@ -79,7 +83,6 @@ const {
79
83
domainToASCII : _domainToASCII ,
80
84
domainToUnicode : _domainToUnicode ,
81
85
encodeAuth,
82
- toUSVString : _toUSVString ,
83
86
parse,
84
87
setURLConstructor,
85
88
URL_FLAGS_CANNOT_BE_BASE ,
@@ -113,18 +116,6 @@ const IteratorPrototype = ObjectGetPrototypeOf(
113
116
ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
114
117
) ;
115
118
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
-
128
119
// Refs: https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque
129
120
const kOpaqueOrigin = 'null' ;
130
121
0 commit comments