Skip to content

Commit ebf17e1

Browse files
committed
JS: Fixup in getComponentRef()
1 parent 607f2d6 commit ebf17e1

File tree

1 file changed

+6
-2
lines changed
  • javascript/ql/lib/semmle/javascript/frameworks

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ module Vue {
160160
}
161161

162162
/**
163-
* Gets an API node referring to the component itself, such as the return value of `new Vue()`.
163+
* Gets an API node referring to the component itself.
164164
*/
165165
API::Node getComponentRef() { none() } // overridden in subclass
166166

@@ -368,7 +368,11 @@ module Vue {
368368
def.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
369369
}
370370

371-
override API::Node getComponentRef() { result = def.getReturn() }
371+
override API::Node getComponentRef() {
372+
// The Vue.extend call is made in the Vue framework; there is no explicit reference
373+
// to the component in user code.
374+
none()
375+
}
372376

373377
override API::Node getOwnOptions() { result = def.getParameter(0) }
374378

0 commit comments

Comments
 (0)