Merge pull request #21159 from asgerf/js/vue-prop-function · Nangal/codeql@077bbb2 · GitHub
Skip to content

Commit 077bbb2

Browse files
authored
Merge pull request github#21159 from asgerf/js/vue-prop-function
JS: Add support for props callbacks in Vue router configs
2 parents 06b99b2 + 9fa856f commit 077bbb2

4 files changed

Lines changed: 38 additions & 15 deletions

File tree

‎javascript/ql/lib/semmle/javascript/frameworks/Vue.qll‎

Lines changed: 4 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The model of `vue-router` now properly detects taint sources in cases where
5+
the `props` property is a callback.

‎javascript/ql/test/library-tests/frameworks/Vue/router.js‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,17 @@ export const router = new Router({
1616
from.query.x;
1717
}
1818
}
19-
]
20-
}
19+
],
20+
props: route => ({
21+
x: route.query.x
22+
}),
23+
},
24+
{
25+
props: {
26+
x: route => route.query.x,
27+
y: route => route.query.y
28+
},
29+
},
2130
],
2231
scrollBehavior(to, from, savedPosition) {
2332
to.query.x;
@@ -34,4 +43,3 @@ router.afterEach((to, from) => {
3443
to.query.x;
3544
from.query.x;
3645
});
37-

‎javascript/ql/test/library-tests/frameworks/Vue/tests.expected‎

Lines changed: 18 additions & 12 deletions

0 commit comments

Comments
 (0)