You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -95,164 +98,147 @@ The abstract operation UpdateLegacyRegExpStaticProperties updates the values of
95
98
1. If _i_ ≤ _n_, set the value of _C_’s [[RegExpParen<i>i</i>]] internal slot to the <i>i</i>th element of _capturedValues_.
96
99
1. Else, set the value of _C_’s [[RegExpParen<i>i</i>]] internal slot to the empty String.
97
100
98
-
101
+
<!--
99
102
## InvalidateLegacyRegExpStaticProperties ( _C_)
100
103
101
104
The abstract operation InvalidateLegacyRegExpStaticProperties marks the values of the static properties of %RegExp% as non-available.
102
105
103
-
_**Open issue.** It is probably more prudent to use the empty String instead of **empty**. See [Issue #6](https://github.com/claudepache/es-regexp-legacy-static-properties/issues/6). (In that case, the special treatment for the **empty** value in the algorithms of the next section will be removed as well.)_
104
-
105
106
106
107
1. Assert: _C_ is an Object that has a [[RegExpInput]] internal slot.
107
-
1. Set the value of _C_’s [[RegExpInput]] internal slot to **empty**.
108
-
1. Set the value of _C_’s [[RegExpLastMatch]] internal slot to **empty**.
109
-
1. Set the value of _C_’s [[RegExpLastParen]] internal slot to **empty**.
110
-
1. Set the value of _C_’s [[RegExpLeftContext]] internal slot to **empty**.
111
-
1. Set the value of _C_’s [[RegExpRightContext]] internal slot to **empty**.
112
-
1. Set the value of _C_’s [[RegExpParen1]] internal slot to **empty**.
113
-
1. Set the value of _C_’s [[RegExpParen2]] internal slot to **empty**.
114
-
1. Set the value of _C_’s [[RegExpParen3]] internal slot to **empty**.
115
-
1. Set the value of _C_’s [[RegExpParen4]] internal slot to **empty**.
116
-
1. Set the value of _C_’s [[RegExpParen5]] internal slot to **empty**.
117
-
1. Set the value of _C_’s [[RegExpParen6]] internal slot to **empty**.
118
-
1. Set the value of _C_’s [[RegExpParen7]] internal slot to **empty**.
119
-
1. Set the value of _C_’s [[RegExpParen8]] internal slot to **empty**.
120
-
1. Set the value of _C_’s [[RegExpParen9]] internal slot to **empty**.
121
-
108
+
1. Set the value of _C_’s [[RegExpInput]] internal slot to the empty String.
109
+
1. Set the value of _C_’s [[RegExpLastMatch]] internal slot to empty String.
110
+
1. Set the value of _C_’s [[RegExpLastParen]] internal slot to empty String.
111
+
1. Set the value of _C_’s [[RegExpLeftContext]] internal slot to empty String.
112
+
1. Set the value of _C_’s [[RegExpRightContext]] internal slot to empty String.
113
+
1. Set the value of _C_’s [[RegExpParen1]] internal slot to empty String.
114
+
1. Set the value of _C_’s [[RegExpParen2]] internal slot to empty String.
115
+
1. Set the value of _C_’s [[RegExpParen3]] internal slot to empty String.
116
+
1. Set the value of _C_’s [[RegExpParen4]] internal slot to empty String.
117
+
1. Set the value of _C_’s [[RegExpParen5]] internal slot to empty String.
118
+
1. Set the value of _C_’s [[RegExpParen6]] internal slot to empty String.
119
+
1. Set the value of _C_’s [[RegExpParen7]] internal slot to empty String.
120
+
1. Set the value of _C_’s [[RegExpParen8]] internal slot to empty String.
121
+
1. Set the value of _C_’s [[RegExpParen9]] internal slot to empty String.
122
+
-->
122
123
123
124
## Additional properties of the RegExp constructor
124
125
125
-
All the below properties have the attributes { [[Enumerable]]: false, [[Configurable]]: true }. Moreover, for the properties whose setter is not explicitely defined, the [[Set]] attribute is set to undefined.
126
+
All the below properties are accessor properties who have the attributes { [[Enumerable]]: false, [[Configurable]]: true }. Moreover, for the properties whose setter is not explicitely defined, the [[Set]] attribute is set to undefined.
127
+
128
+
The accessors check for their this value, so that the properties do not appear to be inherited by subclasses.
126
129
127
130
128
131
### RegExp.input
129
132
#### get RegExp.input
130
133
131
-
1. Let _v_ be the value of %RegExp%’s [[RegExpInput]] internal slot.
132
-
1. If _v_ is **empty**, throw a **TypeError** exception.
133
-
1. Return _v_.
134
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
135
+
1. Return the value of %RegExp%’s [[RegExpInput]] internal slot.
134
136
135
137
#### set RegExp.input = _val_
136
138
139
+
1. If SameValue(%RegExp%, this value) is false, throw a TypeError Exception.
137
140
1. Let _strVal_ be ? ToString(_val_).
138
141
1. Set the value of %RegExp%’s [[RegExpInput]] internal slot to _strVal_.
139
142
140
143
141
144
### RegExp.$_
142
145
#### get RegExp.$_
143
146
144
-
1. Let _v_ be the value of %RegExp%’s [[RegExpInput]] internal slot.
145
-
1. If _v_ is **empty**, throw a **TypeError** exception.
146
-
1. Return _v_.
147
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
148
+
1. Return the value of %RegExp%’s [[RegExpInput]] internal slot.
147
149
148
150
#### set RegExp.$_ = _val_
149
151
152
+
1. If SameValue(%RegExp%, this value) is false, throw a TypeError Exception.
150
153
1. Let _strVal_ be ? ToString(_val_).
151
154
1. Set the value of %RegExp%’s [[RegExpInput]] internal slot to _strVal_.
152
155
153
156
154
157
### get RegExp.lastMatch
155
158
156
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLastMatch]] internal slot.
157
-
1. If _v_ is **empty**, throw a **TypeError** exception.
158
-
1. Return _v_.
159
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
160
+
1. Return the value of %RegExp%’s [[RegExpLastMatch]] internal slot.
159
161
160
162
### get RegExp.$&
161
163
162
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLastMatch]] internal slot.
163
-
1. If _v_ is **empty**, throw a **TypeError** exception.
164
-
1. Return _v_.
164
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
165
+
1. Return the value of %RegExp%’s [[RegExpLastMatch]] internal slot.
165
166
166
167
### get RegExp.lastParen
167
168
168
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLastParen]] internal slot.
169
-
1. If _v_ is **empty**, throw a **TypeError** exception.
170
-
1. Return _v_.
169
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
170
+
1. Return the value of %RegExp%’s [[RegExpLastParen]] internal slot.
171
171
172
172
### get RegExp.$+
173
173
174
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLastParen]] internal slot.
175
-
1. If _v_ is **empty**, throw a **TypeError** exception.
176
-
1. Return _v_.
174
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
175
+
1. Return the value of %RegExp%’s [[RegExpLastParen]] internal slot.
177
176
178
177
### get RegExp.leftContext
179
178
180
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLeftContext]] internal slot.
181
-
1. If _v_ is **empty**, throw a **TypeError** exception.
182
-
1. Return _v_.
179
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
180
+
1. Return the value of %RegExp%’s [[RegExpLeftContext]] internal slot.
183
181
184
182
### get RegExp.$`
185
183
186
-
1. Let _v_ be the value of %RegExp%’s [[RegExpLeftContext]] internal slot.
187
-
1. If _v_ is **empty**, throw a **TypeError** exception.
188
-
1. Return _v_.
184
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
185
+
1. Return the value of %RegExp%’s [[RegExpLeftContext]] internal slot.
189
186
190
187
### get RegExp.rightContext
191
188
192
-
1. Let _v_ be the value of %RegExp%’s [[RegExpRightContext]] internal slot.
193
-
1. If _v_ is **empty**, throw a **TypeError** exception.
194
-
1. Return _v_.
189
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
190
+
1. Return the value of %RegExp%’s [[RegExpRightContext]] internal slot.
195
191
196
192
197
193
### get RegExp.$'
198
194
199
-
1. Let _v_ be the value of %RegExp%’s [[RegExpRightContext]] internal slot.
200
-
1. If _v_ is **empty**, throw a **TypeError** exception.
201
-
1. Return _v_.
195
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
196
+
1. Return the value of %RegExp%’s [[RegExpRightContext]] internal slot.
202
197
203
198
### get RegExp.$1
204
199
205
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen1]] internal slot.
206
-
1. If _v_ is **empty**, throw a **TypeError** exception.
207
-
1. Return _v_.
200
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
201
+
1. Return the value of %RegExp%’s [[RegExpParen1]] internal slot.
208
202
209
203
### get RegExp.$2
210
204
211
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen2]] internal slot.
212
-
1. If _v_ is **empty**, throw a **TypeError** exception.
213
-
1. Return _v_.
205
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
206
+
1. Return the value of %RegExp%’s [[RegExpParen2]] internal slot.
214
207
215
208
### get RegExp.$3
216
209
217
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen3]] internal slot.
218
-
1. If _v_ is **empty**, throw a **TypeError** exception.
219
-
1. Return _v_.
210
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
211
+
1. Return the value of %RegExp%’s [[RegExpParen3]] internal slot.
220
212
221
213
### get RegExp.$4
222
214
223
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen4]] internal slot.
224
-
1. If _v_ is **empty**, throw a **TypeError** exception.
225
-
1. Return _v_.
215
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
216
+
1. Return the value of %RegExp%’s [[RegExpParen4]] internal slot.
226
217
227
218
### get RegExp.$5
228
219
229
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen5]] internal slot.
230
-
1. If _v_ is **empty**, throw a **TypeError** exception.
231
-
1. Return _v_.
220
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
221
+
1. Return the value of %RegExp%’s [[RegExpParen5]] internal slot.
232
222
233
223
### get RegExp.$6
234
224
235
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen6]] internal slot.
236
-
1. If _v_ is **empty**, throw a **TypeError** exception.
237
-
1. Return _v_.
225
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
226
+
1. Return the value of %RegExp%’s [[RegExpParen6]] internal slot.
238
227
239
228
### get RegExp.$7
240
229
241
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen7]] internal slot.
242
-
1. If _v_ is **empty**, throw a **TypeError** exception.
243
-
1. Return _v_.
230
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
231
+
1. Return the value of %RegExp%’s [[RegExpParen7]] internal slot.
244
232
245
233
### get RegExp.$8
246
234
247
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen8]] internal slot.
248
-
1. If _v_ is **empty**, throw a **TypeError** exception.
249
-
1. Return _v_.
235
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
236
+
1. Return the value of %RegExp%’s [[RegExpParen8]] internal slot.
250
237
251
238
### get RegExp.$9
252
239
253
-
1. Let _v_ be the value of %RegExp%’s [[RegExpParen9]] internal slot.
254
-
1. If _v_ is **empty**, throw a **TypeError** exception.
255
-
1. Return _v_.
240
+
1. If SameValue(%RegExp%, this value) is false, return undefined.
241
+
1. Return the value of %RegExp%’s [[RegExpParen9]] internal slot.
0 commit comments