@@ -4,16 +4,13 @@ import { get } from '../internal/client/runtime.js';
4
4
const REPLACE = Symbol ( ) ;
5
5
6
6
export class ReactiveURL extends URL {
7
- #url = {
8
- protocol : source ( super . protocol ) ,
9
- username : source ( super . username ) ,
10
- password : source ( super . password ) ,
11
- hostname : source ( super . hostname ) ,
12
- port : source ( super . port ) ,
13
- pathname : source ( super . pathname ) ,
14
- hash : source ( super . hash )
15
- } ;
16
-
7
+ #protocol = source ( super . protocol ) ;
8
+ #username = source ( super . username ) ;
9
+ #password = source ( super . password ) ;
10
+ #hostname = source ( super . hostname ) ;
11
+ #port = source ( super . port ) ;
12
+ #pathname = source ( super . pathname ) ;
13
+ #hash = source ( super . hash ) ;
17
14
#searchParams = new ReactiveURLSearchParams ( ) ;
18
15
19
16
/**
@@ -27,93 +24,93 @@ export class ReactiveURL extends URL {
27
24
}
28
25
29
26
get hash ( ) {
30
- return get ( this . #url . hash ) ;
27
+ return get ( this . #hash) ;
31
28
}
32
29
33
30
set hash ( value ) {
34
31
super . hash = value ;
35
- set ( this . #url . hash , super . hash ) ;
32
+ set ( this . #hash, super . hash ) ;
36
33
}
37
34
38
35
get host ( ) {
39
- get ( this . #url . hostname ) ;
40
- get ( this . #url . port ) ;
36
+ get ( this . #hostname) ;
37
+ get ( this . #port) ;
41
38
return super . host ;
42
39
}
43
40
44
41
set host ( value ) {
45
42
super . host = value ;
46
- set ( this . #url . hostname , super . hostname ) ;
47
- set ( this . #url . port , super . port ) ;
43
+ set ( this . #hostname, super . hostname ) ;
44
+ set ( this . #port, super . port ) ;
48
45
}
49
46
50
47
get hostname ( ) {
51
- return get ( this . #url . hostname ) ;
48
+ return get ( this . #hostname) ;
52
49
}
53
50
54
51
set hostname ( value ) {
55
52
super . hostname = value ;
56
- set ( this . #url . hostname , super . hostname ) ;
53
+ set ( this . #hostname, super . hostname ) ;
57
54
}
58
55
59
56
get href ( ) {
60
- get ( this . #url . protocol ) ;
61
- get ( this . #url . username ) ;
62
- get ( this . #url . password ) ;
63
- get ( this . #url . hostname ) ;
64
- get ( this . #url . port ) ;
65
- get ( this . #url . pathname ) ;
66
- get ( this . #url . hash ) ;
57
+ get ( this . #protocol) ;
58
+ get ( this . #username) ;
59
+ get ( this . #password) ;
60
+ get ( this . #hostname) ;
61
+ get ( this . #port) ;
62
+ get ( this . #pathname) ;
63
+ get ( this . #hash) ;
67
64
this . #searchParams. toString ( ) ;
68
65
return super . href ;
69
66
}
70
67
71
68
set href ( value ) {
72
69
super . href = value ;
73
- set ( this . #url . protocol , super . protocol ) ;
74
- set ( this . #url . username , super . username ) ;
75
- set ( this . #url . password , super . password ) ;
76
- set ( this . #url . hostname , super . hostname ) ;
77
- set ( this . #url . port , super . port ) ;
78
- set ( this . #url . pathname , super . pathname ) ;
79
- set ( this . #url . hash , super . hash ) ;
70
+ set ( this . #protocol, super . protocol ) ;
71
+ set ( this . #username, super . username ) ;
72
+ set ( this . #password, super . password ) ;
73
+ set ( this . #hostname, super . hostname ) ;
74
+ set ( this . #port, super . port ) ;
75
+ set ( this . #pathname, super . pathname ) ;
76
+ set ( this . #hash, super . hash ) ;
80
77
this . #searchParams[ REPLACE ] ( super . searchParams ) ;
81
78
}
82
79
83
80
get password ( ) {
84
- return get ( this . #url . password ) ;
81
+ return get ( this . #password) ;
85
82
}
86
83
87
84
set password ( value ) {
88
85
super . password = value ;
89
- set ( this . #url . password , super . password ) ;
86
+ set ( this . #password, super . password ) ;
90
87
}
91
88
92
89
get pathname ( ) {
93
- return get ( this . #url . pathname ) ;
90
+ return get ( this . #pathname) ;
94
91
}
95
92
96
93
set pathname ( value ) {
97
94
super . pathname = value ;
98
- set ( this . #url . pathname , super . pathname ) ;
95
+ set ( this . #pathname, super . pathname ) ;
99
96
}
100
97
101
98
get port ( ) {
102
- return get ( this . #url . port ) ;
99
+ return get ( this . #port) ;
103
100
}
104
101
105
102
set port ( value ) {
106
103
super . port = value ;
107
- set ( this . #url . port , super . port ) ;
104
+ set ( this . #port, super . port ) ;
108
105
}
109
106
110
107
get protocol ( ) {
111
- return get ( this . #url . protocol ) ;
108
+ return get ( this . #protocol) ;
112
109
}
113
110
114
111
set protocol ( value ) {
115
112
super . protocol = value ;
116
- set ( this . #url . protocol , super . protocol ) ;
113
+ set ( this . #protocol, super . protocol ) ;
117
114
}
118
115
119
116
get search ( ) {
@@ -127,18 +124,18 @@ export class ReactiveURL extends URL {
127
124
}
128
125
129
126
get username ( ) {
130
- return get ( this . #url . username ) ;
127
+ return get ( this . #username) ;
131
128
}
132
129
133
130
set username ( value ) {
134
131
super . username = value ;
135
- set ( this . #url . username , super . username ) ;
132
+ set ( this . #username, super . username ) ;
136
133
}
137
134
138
135
get origin ( ) {
139
- get ( this . #url . protocol ) ;
140
- get ( this . #url . hostname ) ;
141
- get ( this . #url . port ) ;
136
+ get ( this . #protocol) ;
137
+ get ( this . #hostname) ;
138
+ get ( this . #port) ;
142
139
return super . origin ;
143
140
}
144
141
0 commit comments