Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10a7294

Browse files
committed
JS: Accept trivial test changes
This adds Alert annotations for alerts that seem intentional by the test but has not been annotated with 'NOT OK', or the comment was in the wrong place. In a few cases I included 'Source' expectations to make it easier to see what happened. Other 'Source' expectations will be added in bulk a later commit.
1 parent 0453ded commit 10a7294

177 files changed

Lines changed: 469 additions & 503 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

javascript/ql/test/query-tests/AngularJS/DoubleCompilation/bad.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ angular.module('app').directive('addMouseover', function($compile) {
1111

1212
attrs.$set('addMouseover', null); // To stop infinite compile loop
1313
element.append(newEl);
14-
$compile(element)(scope); // Double compilation
14+
$compile(element)(scope); // $ Alert - Double compilation
1515
}
1616
}
1717
})

javascript/ql/test/query-tests/AngularJS/UseNgSrc/tst.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<body>
77
<a href="{{help_url}}">Help</a> <!-- $ Alert -->
88
<picture>
9-
<source media="(min-width: 650px)" srcset="#/resources/pics-large/{{item._id}}">
10-
<img src="#/resources/pics-default/{{item._id}}">
9+
<source media="(min-width: 650px)" srcset="#/resources/pics-large/{{item._id}}"> <!-- $ Alert -->
10+
<img src="#/resources/pics-default/{{item._id}}"> <!-- $ Alert -->
1111
</picture>
1212

1313
<a ng-href="{{help_url}}">Help</a>
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
#select
21
| AmbiguousIdAttribute.html:4:5:4:14 | id=first | This element has the same id as $@. | AmbiguousIdAttribute.html:5:5:5:14 | id=first | another element |
32
| AmbiguousIdAttribute_fragment.html:2:7:2:16 | id=first | This element has the same id as $@. | AmbiguousIdAttribute_fragment.html:3:7:3:16 | id=first | another element |
43
| tst.js:17:22:17:33 | id="theDiff" | This element has the same id as $@. | tst.js:17:46:17:57 | id="theDiff" | another element |
5-
testFailures
6-
| AmbiguousIdAttribute.html:4:5:4:14 | This element has the same id as $@. | Unexpected result: Alert |
7-
| AmbiguousIdAttribute_fragment.html:2:7:2:16 | This element has the same id as $@. | Unexpected result: Alert |
8-
| tst.js:5:67:5:76 | // $ Alert | Missing result: Alert |
9-
| tst.js:7:68:7:77 | // $ Alert | Missing result: Alert |
10-
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
11-
| tst.js:12:60:12:69 | // $ Alert | Missing result: Alert |
12-
| tst.js:19:51:19:60 | // $ Alert | Missing result: Alert |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<body>
33
<ul>
4-
<li id="first">First element
4+
<li id="first">First element <!-- $ Alert[js/duplicate-html-id] -->
55
<li id="first">Second element
66
</ul>
77
</body>

javascript/ql/test/query-tests/DOM/HTML/AmbiguousIdAttributeGood.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<li id="second">Second element</li>
66
<li id="{{templated-id}}">Templated id</li> <!-- ignored -->
77
<li id="{{templated-id}}">Templated id</li> <!-- ignored -->
8-
<li id="invalid id">Invalid id</li> <!-- reported by another query -->
9-
<li id="invalid id">Invalid id</li> <!-- reported by another query -->
8+
<li id="invalid id">Invalid id</li> <!-- $ Alert[js/malformed-html-id] -->
9+
<li id="invalid id">Invalid id</li> <!-- $ Alert[js/malformed-html-id] -->
1010
<li class="duplicate-class">duplicate-class</li>
1111
<li class="duplicate-class">duplicate-class</li>
1212
</ul>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<ul>
2-
<li id="first">First element
2+
<li id="first">First element <!-- $ Alert[js/duplicate-html-id] -->
33
<li id="first">Second element
44
</ul>
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
#select
21
| ConflictingAttributes.html:1:4:1:27 | href=http://semmle.com | This attribute has the same name as $@ of the same element, but a different value. | ConflictingAttributes.html:1:29:1:53 | href=https://semmle.com | another attribute |
32
| tst.js:5:4:5:27 | href="h ... le.com" | This attribute has the same name as $@ of the same element, but a different value. | tst.js:5:29:5:53 | href="h ... le.com" | another attribute |
43
| tst.js:12:4:12:27 | href="h ... le.com" | This attribute has the same name as $@ of the same element, but a different value. | tst.js:12:29:12:46 | href={someValue()} | another attribute |
5-
testFailures
6-
| ConflictingAttributes.html:1:4:1:27 | This attribute has the same name as $@ of the same element, but a different value. | Unexpected result: Alert |
7-
| tst.js:7:68:7:77 | // $ Alert | Missing result: Alert |
8-
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
9-
| tst.js:17:73:17:82 | // $ Alert | Missing result: Alert |
10-
| tst.js:19:51:19:60 | // $ Alert | Missing result: Alert |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a href="http://semmle.com" href="https://semmle.com">Semmle</a>
1+
<a href="http://semmle.com" href="https://semmle.com">Semmle</a> <!-- $ Alert[js/conflicting-html-attribute] -->
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
#select
21
| DuplicateAttributes.html:1:4:1:28 | href=https://semmle.com | This attribute $@. | DuplicateAttributes.html:1:30:1:54 | href=https://semmle.com | is duplicated later |
32
| tst.js:7:4:7:28 | href="h ... le.com" | This attribute $@. | tst.js:7:30:7:54 | href="h ... le.com" | is duplicated later |
43
| tst.js:19:17:19:28 | id="theDiff" | This attribute $@. | tst.js:19:30:19:41 | id="theDiff" | is duplicated later |
5-
testFailures
6-
| DuplicateAttributes.html:1:4:1:28 | This attribute $@. | Unexpected result: Alert |
7-
| tst.js:5:67:5:76 | // $ Alert | Missing result: Alert |
8-
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
9-
| tst.js:12:60:12:69 | // $ Alert | Missing result: Alert |
10-
| tst.js:17:73:17:82 | // $ Alert | Missing result: Alert |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<a href="https://semmle.com" href="https://semmle.com">Semmle</a>
1+
<a href="https://semmle.com" href="https://semmle.com">Semmle</a> <!-- $ Alert[js/duplicate-html-attribute] -->
22

33
<td {% foo %} {% foo %}></td>

0 commit comments

Comments
 (0)