File tree Expand file tree Collapse file tree 7 files changed +17
-17
lines changed
javascript/ql/test/query-tests
ImplicitOperandConversion
LanguageFeatures/IllegalInvocation
React/UnusedOrUndefinedStateProperty Expand file tree Collapse file tree 7 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ function l() {
7474 x ** 2 ; // $ Alert
7575}
7676
77- 1n + 1 ; // $ MISSED : Alert
77+ 1n + 1 ; // $ MISSING : Alert
7878
7979( function ( ) {
8080 let sum = 0 ;
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ function useThingPossiblySync(b) {
5959
6060 if ( thing == null ) { }
6161
62- return thing + "bar" ; // $ MISSED : Alert
62+ return thing + "bar" ; // $ MISSING : Alert
6363}
6464
6565function useThingInVoid ( ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function foo() {
66
77function bar ( ) {
88 var g ;
9- g ( ) ; // $ MISSED : Alert
9+ g ( ) ; // $ MISSING : Alert
1010 eval ( "g = alert" ) ;
1111}
1212
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ let c = new C();
1212C ( ) ; // $ Alert
1313new ( x => x ) ; // $ Alert
1414c . m ( ) ;
15- new c . m ( ) ; // $ MISSED : Alert
15+ new c . m ( ) ; // $ MISSING : Alert
1616
1717var o = {
1818 f : function ( ) { } ,
@@ -21,7 +21,7 @@ var o = {
2121o . f ( ) ;
2222new o . f ( ) ;
2323o . g ( ) ;
24- new o . g ( ) ; // $ MISSED : Alert
24+ new o . g ( ) ; // $ MISSING : Alert
2525
2626function f ( b ) {
2727 var g ;
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ class C1 extends React.Component {
99 }
1010}
1111
12- class C2 extends React . Component {
12+ class C2 extends React . Component { // $ Alert
1313
1414 state = {
15- p1 : ''
15+ p1 : '' // $ RelatedLocation
1616 }
1717
1818 static getDerivedStateFromProps_unmodeled ( props , state ) {
Original file line number Diff line number Diff line change 1- class C1 extends React . Component {
1+ class C1 extends React . Component { // $ Alert
22 constructor ( ) {
33 this . state . writtenDirectly = 42 ;
44 this . setState ( {
55 writtenInSetState : 42
66 } ) ;
77 this . state . writtenInOtherMethod ;
8- this . state . notWritten ; // $ Alert
9- this . state . notWrittenButReadInChain ; // $ Alert
8+ this . state . notWritten ; // $ RelatedLocation
9+ this . state . notWrittenButReadInChain ; // $ RelatedLocation
1010 this . state . writtenDirectly ;
1111 this . state . writtenInSetState ;
1212
@@ -29,10 +29,10 @@ class C2 extends React.Component {
2929}
3030
3131
32- class C3 extends React . Component {
32+ class C3 extends React . Component { // $ Alert
3333 constructor ( ) {
3434 this . state . writtenThrougExternalPropertyAccess ;
35- this . state . notWrittenThrougExternalPropertyAccess ; // $ Alert
35+ this . state . notWrittenThrougExternalPropertyAccess ; // $ RelatedLocation
3636 }
3737}
3838
Original file line number Diff line number Diff line change 1- class C1 extends React . Component {
1+ class C1 extends React . Component { // $ Alert
22 constructor ( ) {
33 this . state . readDirectly = 42 ;
44 this . state . readInChain = { } ;
55 this . state . readInOtherMethod = { } ;
6- this . state . notRead = 42 ; // $ Alert
6+ this . state . notRead = 42 ; // $ RelatedLocation
77 this . state . readDirectly ;
88 this . state . readInChain . foo ;
99 }
@@ -18,16 +18,16 @@ function f(s){
1818}
1919class C2 extends React . Component {
2020 constructor ( ) {
21- this . state . readWhenEscaped = 42 ; // $ Alert
21+ this . state . readWhenEscaped = 42 ; // $ MISSING: Alert
2222 f ( this . state ) ;
2323 }
2424}
2525
2626
27- class C3 extends React . Component {
27+ class C3 extends React . Component { // $ Alert
2828 constructor ( ) {
2929 this . state . readThrougExternaPropertyAccess = 42 ;
30- this . state . notReadThrougExternaPropertyAccess = 42 ; // $ Alert
30+ this . state . notReadThrougExternaPropertyAccess = 42 ; // $ RelatedLocation
3131 }
3232}
3333
You can’t perform that action at this time.
0 commit comments