Skip to content

Commit b210719

Browse files
committed
JS: Rename variables to match new class name
1 parent 0a98679 commit b210719

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

javascript/ql/src/semmle/javascript/frameworks/Vue.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,13 @@ module Vue {
535535
*/
536536
class VHtmlSourceWrite extends TaintTracking::SharedTaintStep {
537537
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
538-
exists(Vue::Component instance, string expr, VHtmlAttribute attr |
538+
exists(Vue::Component component, string expr, VHtmlAttribute attr |
539539
attr.getAttr().getRoot() =
540-
instance.getTemplateElement().(Vue::Template::HtmlElement).getElement() and
540+
component.getTemplateElement().(Vue::Template::HtmlElement).getElement() and
541541
expr = attr.getAttr().getValue() and
542542
// only support for simple identifier expressions
543543
expr.regexpMatch("(?i)[a-z0-9_]+") and
544-
pred = instance.getAPropertyValue(expr) and
544+
pred = component.getAPropertyValue(expr) and
545545
succ = attr
546546
)
547547
}
@@ -642,15 +642,15 @@ module Vue {
642642
or
643643
result = routeConfig().getMember("beforeEnter").getParameter([0, 1]).getAnImmediateUse()
644644
or
645-
exists(Component i |
646-
result = i.getABoundFunction().getAFunctionValue().getReceiver().getAPropertyRead("$route")
645+
exists(Component c |
646+
result = c.getABoundFunction().getAFunctionValue().getReceiver().getAPropertyRead("$route")
647647
or
648648
result =
649-
i.getALifecycleHook(["beforeRouteEnter", "beforeRouteUpdate", "beforeRouteLeave"])
649+
c.getALifecycleHook(["beforeRouteEnter", "beforeRouteUpdate", "beforeRouteLeave"])
650650
.getAFunctionValue()
651651
.getParameter([0, 1])
652652
or
653-
result = i.getWatchHandler("$route").getParameter([0, 1])
653+
result = c.getWatchHandler("$route").getParameter([0, 1])
654654
)
655655
)
656656
or
@@ -668,7 +668,7 @@ module Vue {
668668
this = routeObject().getAPropertyRead(name)
669669
or
670670
exists(string prop |
671-
this = any(Component i).getWatchHandler(prop).getParameter([0, 1]) and
671+
this = any(Component c).getWatchHandler(prop).getParameter([0, 1]) and
672672
name = prop.regexpCapture("\\$route\\.(params|query|hash|path|fullPath)\\b.*", 1)
673673
)
674674
|

javascript/ql/src/semmle/javascript/frameworks/Vuex.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private module VueAPI {
2626
* or equivalent.
2727
*/
2828
class VueConfigObject extends API::Node {
29-
VueConfigObject() { this.getARhs() = any(Vue::Component i).getOwnOptionsObject() }
29+
VueConfigObject() { this.getARhs() = any(Vue::Component c).getOwnOptionsObject() }
3030

3131
/** Gets an API node representing `this` in the Vue component. */
3232
API::Node getAnInstanceRef() {

javascript/ql/src/semmle/javascript/security/dataflow/Xss.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ module DomBasedXss {
347347
class VueTemplateSink extends DomBasedXss::Sink {
348348
VueTemplateSink() {
349349
// Note: don't use Vue::Instance#getTemplate as it includes an unwanted getALocalSource() step
350-
this = any(Vue::Component i).getOption("template")
350+
this = any(Vue::Component c).getOption("template")
351351
}
352352
}
353353

@@ -357,8 +357,8 @@ module DomBasedXss {
357357
*/
358358
class VueCreateElementSink extends DomBasedXss::Sink {
359359
VueCreateElementSink() {
360-
exists(Vue::Component i, DataFlow::FunctionNode f |
361-
f.flowsTo(i.getRender()) and
360+
exists(Vue::Component c, DataFlow::FunctionNode f |
361+
f.flowsTo(c.getRender()) and
362362
this = f.getParameter(0).getACall().getArgument(0)
363363
)
364364
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import javascript
22
import semmle.javascript.security.dataflow.Xss
33

4-
query predicate instance_getAPropertyValue(Vue::Component i, string name, DataFlow::Node prop) {
5-
i.getAPropertyValue(name) = prop
4+
query predicate instance_getAPropertyValue(Vue::Component c, string name, DataFlow::Node prop) {
5+
c.getAPropertyValue(name) = prop
66
}
77

8-
query predicate instance_getOption(Vue::Component i, string name, DataFlow::Node prop) {
9-
i.getOption(name) = prop
8+
query predicate instance_getOption(Vue::Component c, string name, DataFlow::Node prop) {
9+
c.getOption(name) = prop
1010
}
1111

12-
query predicate instance(Vue::Component i) { any() }
12+
query predicate instance(Vue::Component c) { any() }
1313

1414
query predicate instance_heapStep(
1515
Vue::InstanceHeapStep step, DataFlow::Node pred, DataFlow::Node succ

0 commit comments

Comments
 (0)