Skip to content

Commit ae4d2a6

Browse files
JS-831 Improve detection of S1523 and S2755 (#5951)
1 parent 0716089 commit ae4d2a6

File tree

12 files changed

+69
-12
lines changed

12 files changed

+69
-12
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"TypeScript:src/harness/fourslash.ts": [
33
588,
4-
2886
4+
2886,
5+
2887
56
],
67
"TypeScript:src/harness/harness.ts": [
7-
87
8+
87,
9+
92,
10+
95
811
]
912
}

its/ruling/src/test/expected/jsts/ace/javascript-S1523.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"ace:demo/kitchen-sink/dev_util.js": [
3-
166
3+
166,
4+
167
45
],
56
"ace:experiments/worker.js": [
67
2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"es5-shim:es5-sham.js": [
33
255
4+
],
5+
"es5-shim:es5-shim.js": [
6+
302
47
]
58
}

its/ruling/src/test/expected/jsts/file-for-rules/javascript-S1451.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"file-for-rules:S1291.js": [
66
0
77
],
8+
"file-for-rules:S1523.js": [
9+
0
10+
],
811
"file-for-rules:S1534.js": [
912
0
1013
],
@@ -23,6 +26,9 @@
2326
"file-for-rules:S2639.js": [
2427
0
2528
],
29+
"file-for-rules:S2755.js": [
30+
0
31+
],
2632
"file-for-rules:S2871.js": [
2733
0
2834
],
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"file-for-rules:S1523.js": [
3+
5
4+
]
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"file-for-rules:S2755.js": [
3+
8
4+
]
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"redux:test/utils/isPlainObject.spec.js": [
3+
12
4+
]
5+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"sizzle:speed/speed.js": [
3-
371
3+
371,
4+
378
45
]
56
}

its/sources/jsts/custom/S1523.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import vm from 'node:vm';
2+
3+
const sandbox = { data: 'data' };
4+
vm.createContext(sandbox);
5+
vm.runInContext('code', sandbox, { timeout: 2000 });

its/sources/jsts/custom/S2755.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import libxmljs from 'libxmljs';
2+
import libxmljs2 from 'libxmljs2';
3+
import fs from 'node:fs';
4+
5+
const xml = fs.readFileSync('xxe.xml', 'utf8');
6+
const opts = { noblanks: true, noent: true, nocdata: true };
7+
8+
libxmljs.parseXmlString(xml, { noblanks: true, noent: true, nocdata: true }); // Detected
9+
libxmljs2.parseXmlString(xml, opts); // Undetected

0 commit comments

Comments
 (0)