Skip to content

Commit cde8059

Browse files
committed
JS: Update some comments referring to Vue instances
1 parent 165f6c6 commit cde8059

File tree

2 files changed

+21
-21
lines changed
  • javascript/ql/src/semmle/javascript

2 files changed

+21
-21
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,23 @@ module Vue {
132132
DataFlow::Node getOwnOptionsObject() { none() } // overridden in subclasses
133133

134134
/**
135-
* Gets the class component implementing this Vue instance, if any.
135+
* Gets the class implementing this Vue component, if any.
136136
*
137137
* Specifically, this is a class annotated with `@Component` which flows to the options
138-
* object of this Vue instance.
138+
* object of this Vue component.
139139
*/
140140
ClassComponent getAsClassComponent() { result.flowsTo(getOwnOptionsObject()) }
141141

142142
/**
143-
* Gets the node for option `name` for this instance, this does not include
143+
* Gets the node for option `name` for this component, not including
144144
* those from extended objects and mixins.
145145
*/
146146
DataFlow::Node getOwnOption(string name) {
147147
result = getOwnOptionsObject().getALocalSource().getAPropertyWrite(name).getRhs()
148148
}
149149

150150
/**
151-
* Gets the node for option `name` for this instance, including those from
151+
* Gets the node for option `name` for this component, including those from
152152
* extended objects and mixins.
153153
*/
154154
DataFlow::Node getOption(string name) {
@@ -173,25 +173,25 @@ module Vue {
173173
}
174174

175175
/**
176-
* Gets a source node flowing into the option `name` of this instance, including those from
176+
* Gets a source node flowing into the option `name` of this component, including those from
177177
* extended objects and mixins.
178178
*/
179179
pragma[nomagic]
180180
DataFlow::SourceNode getOptionSource(string name) { result = getOption(name).getALocalSource() }
181181

182182
/**
183-
* Gets the template element used by this instance, if any.
183+
* Gets the template element used by this component, if any.
184184
*/
185185
Template::Element getTemplateElement() { none() } // overridden in subclasses
186186

187187
/**
188-
* Gets the node for the `data` option object of this instance.
188+
* Gets the node for the `data` option object of this component.
189189
*/
190190
DataFlow::Node getData() {
191191
exists(DataFlow::Node data | data = getOption("data") |
192192
result = data
193193
or
194-
// a constructor variant is available for all instance definitions
194+
// a constructor variant is available for all component definitions
195195
exists(DataFlow::FunctionNode f |
196196
f.flowsTo(data) and
197197
result = f.getAReturn()
@@ -204,13 +204,13 @@ module Vue {
204204
}
205205

206206
/**
207-
* Gets the node for the `template` option of this instance.
207+
* Gets the node for the `template` option of this component.
208208
*/
209209
pragma[nomagic]
210210
DataFlow::SourceNode getTemplate() { result = getOptionSource("template") }
211211

212212
/**
213-
* Gets the node for the `render` option of this instance.
213+
* Gets the node for the `render` option of this component.
214214
*/
215215
pragma[nomagic]
216216
DataFlow::SourceNode getRender() {
@@ -220,19 +220,19 @@ module Vue {
220220
}
221221

222222
/**
223-
* Gets the node for the `methods` option of this instance.
223+
* Gets the node for the `methods` option of this component.
224224
*/
225225
pragma[nomagic]
226226
DataFlow::SourceNode getMethods() { result = getOptionSource("methods") }
227227

228228
/**
229-
* Gets the node for the `computed` option of this instance.
229+
* Gets the node for the `computed` option of this component.
230230
*/
231231
pragma[nomagic]
232232
DataFlow::SourceNode getComputed() { result = getOptionSource("computed") }
233233

234234
/**
235-
* Gets the node for the `watch` option of this instance.
235+
* Gets the node for the `watch` option of this component.
236236
*/
237237
pragma[nomagic]
238238
DataFlow::SourceNode getWatch() { result = getOptionSource("watch") }
@@ -249,7 +249,7 @@ module Vue {
249249
}
250250

251251
/**
252-
* Gets a node for a member of the `methods` option of this instance.
252+
* Gets a node for a member of the `methods` option of this component.
253253
*/
254254
pragma[nomagic]
255255
private DataFlow::SourceNode getAMethod() {
@@ -260,7 +260,7 @@ module Vue {
260260
}
261261

262262
/**
263-
* Gets a node for a member of the `computed` option of this instance that matches `kind`.
263+
* Gets a node for a member of the `computed` option of this component that matches `kind`.
264264
*/
265265
pragma[nomagic]
266266
private DataFlow::SourceNode getAnAccessor(DataFlow::MemberKind kind) {
@@ -273,7 +273,7 @@ module Vue {
273273
}
274274

275275
/**
276-
* Gets a node for a member `name` of the `computed` option of this instance that matches `kind`.
276+
* Gets a node for a member `name` of the `computed` option of this component that matches `kind`.
277277
*/
278278
private DataFlow::SourceNode getAccessor(string name, DataFlow::MemberKind kind) {
279279
result = getComputed().getAPropertySource(name) and kind = DataFlow::MemberKind::getter()
@@ -285,7 +285,7 @@ module Vue {
285285
}
286286

287287
/**
288-
* Gets the node for the life cycle hook of the `hookName` option of this instance.
288+
* Gets the node for the life cycle hook of the `hookName` option of this component.
289289
*/
290290
pragma[nomagic]
291291
DataFlow::SourceNode getALifecycleHook(string hookName) {
@@ -298,7 +298,7 @@ module Vue {
298298
}
299299

300300
/**
301-
* Gets a node for a function that will be invoked with `this` bound to this instance.
301+
* Gets a node for a function that will be invoked with `this` bound to this component.
302302
*/
303303
DataFlow::FunctionNode getABoundFunction() {
304304
result = getAMethod()
@@ -325,7 +325,7 @@ module Vue {
325325
}
326326

327327
/**
328-
* Gets the data flow node that flows into the property `name` of this instance, or is
328+
* Gets the data flow node that flows into the property `name` of this component, or is
329329
* returned form a getter defining that property.
330330
*/
331331
DataFlow::Node getAPropertyValue(string name) {
@@ -339,7 +339,7 @@ module Vue {
339339
}
340340

341341
/**
342-
* A Vue instance from `new Vue({...})`.
342+
* A Vue component from `new Vue({...})`.
343343
*/
344344
class VueInstance extends Component, MkVueInstance {
345345
DataFlow::NewNode def;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ module DomBasedXss {
346346
*/
347347
class VueTemplateSink extends DomBasedXss::Sink {
348348
VueTemplateSink() {
349-
// Note: don't use Vue::Instance#getTemplate as it includes an unwanted getALocalSource() step
349+
// Note: don't use Vue::Component#getTemplate as it includes an unwanted getALocalSource() step
350350
this = any(Vue::Component c).getOption("template")
351351
}
352352
}

0 commit comments

Comments
 (0)