141 lines
2.4 KiB
Plaintext
141 lines
2.4 KiB
Plaintext
This test checks our implementation of the special RegExp member variables.
|
|
|
|
Properties of RegExp at startup:
|
|
$&: {} (read-only)
|
|
$': {} (read-only)
|
|
$*: {false} (read-write)
|
|
$+: {} (read-only)
|
|
$1: {} (read-only)
|
|
$2: {} (read-only)
|
|
$3: {} (read-only)
|
|
$4: {} (read-only)
|
|
$5: {} (read-only)
|
|
$6: {} (read-only)
|
|
$7: {} (read-only)
|
|
$8: {} (read-only)
|
|
$9: {} (read-only)
|
|
$_: {} (read-write)
|
|
$`: {} (read-only)
|
|
input: {} (read-write)
|
|
lastMatch: {} (read-only)
|
|
lastParen: {} (read-only)
|
|
leftContext: {} (read-only)
|
|
length: {2} (read-only)
|
|
multiline: {false} (read-write)
|
|
name: {RegExp} (read-only)
|
|
prototype: {/(?:)/} (read-only)
|
|
rightContext: {} (read-only)
|
|
|
|
Properties of RegExp after /(1)(2)(3)(4)(5)(6)(7)(8)(9)(0)/.exec(<1234567890>):
|
|
$&: {1234567890}
|
|
$': {>}
|
|
$*: {false}
|
|
$+: {0}
|
|
$1: {1}
|
|
$2: {2}
|
|
$3: {3}
|
|
$4: {4}
|
|
$5: {5}
|
|
$6: {6}
|
|
$7: {7}
|
|
$8: {8}
|
|
$9: {9}
|
|
$_: {<1234567890>}
|
|
$`: {<}
|
|
input: {<1234567890>}
|
|
lastMatch: {1234567890}
|
|
lastParen: {0}
|
|
leftContext: {<}
|
|
length: {2}
|
|
multiline: {false}
|
|
name: {RegExp}
|
|
prototype: {/(?:)/}
|
|
rightContext: {>}
|
|
|
|
RegExp.$0 does not exist
|
|
RegExp.$10 does not exist
|
|
RegExp doesn't use RegExp.input
|
|
RegExp.multiline coerces values to booleans
|
|
RegExp.input coerces values to strings
|
|
|
|
Properties of RegExp after /(1)(2)(3)(4)(5)(6)(7)(8)(9)(0)/.exec(XXX):
|
|
$&: {1234567890}
|
|
$': {>}
|
|
$*: {true}
|
|
$+: {0}
|
|
$1: {1}
|
|
$2: {2}
|
|
$3: {3}
|
|
$4: {4}
|
|
$5: {5}
|
|
$6: {6}
|
|
$7: {7}
|
|
$8: {8}
|
|
$9: {9}
|
|
$_: {0}
|
|
$`: {<}
|
|
input: {0}
|
|
lastMatch: {1234567890}
|
|
lastParen: {0}
|
|
leftContext: {<}
|
|
length: {2}
|
|
multiline: {true}
|
|
name: {RegExp}
|
|
prototype: {/(?:)/}
|
|
rightContext: {>}
|
|
|
|
---------- [Cleared RegExp values] ----------
|
|
Properties of RegExp after <1234567890>.search(/(1)(2)(3)(4)(5)(6)(7)(8)(9)(0)/):
|
|
$&: {1234567890}
|
|
$': {>}
|
|
$*: {true}
|
|
$+: {0}
|
|
$1: {1}
|
|
$2: {2}
|
|
$3: {3}
|
|
$4: {4}
|
|
$5: {5}
|
|
$6: {6}
|
|
$7: {7}
|
|
$8: {8}
|
|
$9: {9}
|
|
$_: {<1234567890>}
|
|
$`: {<}
|
|
input: {<1234567890>}
|
|
lastMatch: {1234567890}
|
|
lastParen: {0}
|
|
leftContext: {<}
|
|
length: {2}
|
|
multiline: {true}
|
|
name: {RegExp}
|
|
prototype: {/(?:)/}
|
|
rightContext: {>}
|
|
|
|
---------- [Cleared RegExp values] ----------
|
|
Properties of RegExp after <1234567890>.replace(/(1)(2)(3)(4)(5)(6)(7)(8)(9)(0)/):
|
|
$&: {1234567890}
|
|
$': {>}
|
|
$*: {true}
|
|
$+: {0}
|
|
$1: {1}
|
|
$2: {2}
|
|
$3: {3}
|
|
$4: {4}
|
|
$5: {5}
|
|
$6: {6}
|
|
$7: {7}
|
|
$8: {8}
|
|
$9: {9}
|
|
$_: {<1234567890>}
|
|
$`: {<}
|
|
input: {<1234567890>}
|
|
lastMatch: {1234567890}
|
|
lastParen: {0}
|
|
leftContext: {<}
|
|
length: {2}
|
|
multiline: {true}
|
|
name: {RegExp}
|
|
prototype: {/(?:)/}
|
|
rightContext: {>}
|
|
|