Merge pull request #3834 from asger-semmle/js/vue-classification

Approved by erik-krogh
This commit is contained in:
semmle-qlci
2020-06-30 13:14:25 +01:00
committed by GitHub
3 changed files with 13 additions and 2 deletions

View File

@@ -80,6 +80,8 @@ predicate classify(File f, string category) {
or
// Polymer templates
exists(HTML::Element elt | elt.getName() = "template" |
f = elt.getFile() and category = "template"
f = elt.getFile() and
category = "template" and
not f.getExtension() = "vue"
)
}

View File

@@ -164,7 +164,10 @@ private int countStartingHtmlElements(File f, int l) {
/**
* Holds if the base name of `f` is a number followed by a single extension.
*/
predicate isGeneratedFileName(File f) { f.getStem().regexpMatch("[0-9]+") }
predicate isGeneratedFileName(File f) {
f.getStem().regexpMatch("[0-9]+") and
not f.getExtension() = "vue"
}
/**
* Holds if `tl` looks like it contains generated code.

View File

@@ -0,0 +1,6 @@
<template>
<span>hey</span>
</template>
<script>
export default { data: 42 }
</script>