1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! §22.2.3's internal slots — what a `RegExp` object *is*, apart from its properties.
//!
//! # Why the source text is kept beside the parsed pattern
//!
//! `RegExp.prototype.source` must answer the pattern as written, not as understood: `/a\/b/.source`
//! is `a\/b` and no tree can say that. §22.2.6.13 also requires a form that can be put back between
//! slashes and read again, which is why an empty pattern reads as `(?:)` — so the text kept here is
//! the *escaped* one, computed once when the object is made.
//!
//! # Why `lastIndex` is not here
//!
//! It is an ordinary property, writable and non-configurable, and a program may set it to anything
//! at all — including a string, or a number past the end of any subject. §22.2.7.2 reads it with
//! `ToLength` every time rather than trusting it, so keeping a copy in a slot would mean two
//! answers that could disagree.
use crate;
/// §22.2.3's `[[OriginalSource]]`, `[[OriginalFlags]]` and `[[RegExpMatcher]]`.