File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
javascript/ql/test/query-tests/RegExp/IdentityReplacement Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 22| tst.js:1:13:1:16 | "\\\\" | This replaces '\\' with itself. |
33| tst.js:2:13:2:18 | /(\\\\)/ | This replaces '\\' with itself. |
44| tst.js:3:13:3:17 | /["]/ | This replaces '"' with itself. |
5+ | tst.js:6:13:6:18 | /foo/g | This replaces 'foo' with itself. |
6+ | tst.js:9:13:9:17 | /^\\\\/ | This replaces '\\' with itself. |
7+ | tst.js:10:13:10:17 | /\\\\$/ | This replaces '\\' with itself. |
8+ | tst.js:11:13:11:18 | /\\b\\\\/ | This replaces '\\' with itself. |
9+ | tst.js:12:13:12:18 | /\\B\\\\/ | This replaces '\\' with itself. |
10+ | tst.js:13:13:13:22 | /\\\\(?!\\\\)/ | This replaces '\\' with itself. |
11+ | tst.js:14:13:14:23 | /(?<!\\\\)\\\\/ | This replaces '\\' with itself. |
12+ | tst.js:16:13:16:15 | /^/ | This replaces the empty string with itself. |
Original file line number Diff line number Diff line change @@ -2,3 +2,15 @@ raw.replace("\\", "\\"); // NOT OK
22raw . replace ( / ( \\ ) / , "\\" ) ; // NOT OK
33raw . replace ( / [ " ] / , "\"" ) ; // NOT OK
44raw . replace ( "\\" , "\\\\" ) ; // OK
5+
6+ raw . replace ( / f o o / g, 'foo' ) ; // NOT OK
7+ raw . replace ( / f o o / gi, 'foo' ) ; // OK
8+
9+ raw . replace ( / ^ \\ / , "\\" ) ; // NOT OK
10+ raw . replace ( / \\ $ / , "\\" ) ; // NOT OK
11+ raw . replace ( / \b \\ / , "\\" ) ; // NOT OK
12+ raw . replace ( / \B \\ / , "\\" ) ; // NOT OK
13+ raw . replace ( / \\ (? ! \\ ) / , "\\" ) ; // NOT OK
14+ raw . replace ( / (?< ! \\ ) \\ / , "\\" ) ; // NOT OK
15+
16+ raw . replace ( / ^ / , "" ) ; // NOT OK
You can’t perform that action at this time.
0 commit comments