@@ -340,12 +340,12 @@ class FunctionNode extends DataFlow::ValueNode, DataFlow::SourceNode {
340340 int getNumParameter ( ) { result = count ( astNode .getAParameter ( ) ) }
341341
342342 /** Gets the last parameter of this function. */
343- ParameterNode getLastParameter ( ) { result = getParameter ( getNumParameter ( ) - 1 ) }
343+ ParameterNode getLastParameter ( ) { result = getParameter ( getNumParameter ( ) - 1 ) }
344344
345345 /** Holds if the last parameter of this function is a rest parameter. */
346346 predicate hasRestParameter ( ) { astNode .hasRestParameter ( ) }
347347
348- /** Gets the name of this function, if it has one. */
348+ /** Gets the unqualified name of this function, if it has one or one can be determined from the context . */
349349 string getName ( ) { result = astNode .getName ( ) }
350350
351351 /** Gets a data flow node corresponding to a return value of this function. */
@@ -576,7 +576,7 @@ class ClassNode extends DataFlow::SourceNode {
576576 ClassNode ( ) { this = impl }
577577
578578 /**
579- * Gets the name of the class, if it has one.
579+ * Gets the unqualified name of the class, if it has one or one can be determined from the context .
580580 */
581581 string getName ( ) { result = impl .getName ( ) }
582582
@@ -651,16 +651,12 @@ class ClassNode extends DataFlow::SourceNode {
651651 /**
652652 * Gets a direct super class of this class.
653653 */
654- ClassNode getADirectSuperClass ( ) {
655- result .getAClassReference ( ) .flowsTo ( getASuperClassNode ( ) )
656- }
654+ ClassNode getADirectSuperClass ( ) { result .getAClassReference ( ) .flowsTo ( getASuperClassNode ( ) ) }
657655
658656 /**
659657 * Gets a direct subclass of this class.
660658 */
661- final ClassNode getADirectSubClass ( ) {
662- this = result .getADirectSuperClass ( )
663- }
659+ final ClassNode getADirectSubClass ( ) { this = result .getADirectSuperClass ( ) }
664660
665661 /**
666662 * Gets the receiver of an instance member or constructor of this class.
@@ -674,16 +670,12 @@ class ClassNode extends DataFlow::SourceNode {
674670 /**
675671 * Gets the abstract value representing the class itself.
676672 */
677- AbstractValue getAbstractClassValue ( ) {
678- result = this .( AnalyzedNode ) .getAValue ( )
679- }
673+ AbstractValue getAbstractClassValue ( ) { result = this .( AnalyzedNode ) .getAValue ( ) }
680674
681675 /**
682676 * Gets the abstract value representing an instance of this class.
683677 */
684- AbstractValue getAbstractInstanceValue ( ) {
685- result = AbstractInstance:: of ( getAstNode ( ) )
686- }
678+ AbstractValue getAbstractInstanceValue ( ) { result = AbstractInstance:: of ( getAstNode ( ) ) }
687679
688680 /**
689681 * Gets a dataflow node that refers to this class object.
@@ -692,9 +684,7 @@ class ClassNode extends DataFlow::SourceNode {
692684 t .start ( ) and
693685 result .( AnalyzedNode ) .getAValue ( ) = getAbstractClassValue ( )
694686 or
695- exists ( DataFlow:: TypeTracker t2 |
696- result = getAClassReference ( t2 ) .track ( t2 , t )
697- )
687+ exists ( DataFlow:: TypeTracker t2 | result = getAClassReference ( t2 ) .track ( t2 , t ) )
698688 }
699689
700690 /**
@@ -725,9 +715,7 @@ class ClassNode extends DataFlow::SourceNode {
725715
726716 pragma [ noinline]
727717 private DataFlow:: SourceNode getAnInstanceReferenceAux ( DataFlow:: TypeTracker t ) {
728- exists ( DataFlow:: TypeTracker t2 |
729- result = getAnInstanceReference ( t2 ) .track ( t2 , t )
730- )
718+ exists ( DataFlow:: TypeTracker t2 | result = getAnInstanceReference ( t2 ) .track ( t2 , t ) )
731719 }
732720
733721 /**
@@ -846,11 +834,12 @@ module ClassNode {
846834 */
847835 class FunctionStyleClass extends Range , DataFlow:: ValueNode {
848836 override Function astNode ;
837+
849838 AbstractFunction function ;
850839
851840 FunctionStyleClass ( ) {
852841 function .getFunction ( ) = astNode and
853- exists ( DataFlow:: PropRef read |
842+ exists ( DataFlow:: PropRef read |
854843 read .getPropertyName ( ) = "prototype" and
855844 read .getBase ( ) .analyze ( ) .getAValue ( ) = function
856845 )
@@ -902,15 +891,13 @@ module ClassNode {
902891
903892 override FunctionNode getStaticMethod ( string name ) { result = getAPropertySource ( name ) }
904893
905- override FunctionNode getAStaticMethod ( ) {
906- result = getAPropertySource ( )
907- }
894+ override FunctionNode getAStaticMethod ( ) { result = getAPropertySource ( ) }
908895
909896 /**
910897 * Gets a reference to the prototype of this class.
911898 */
912899 DataFlow:: SourceNode getAPrototypeReference ( ) {
913- exists ( DataFlow:: SourceNode base | base .analyze ( ) .getAValue ( ) = function |
900+ exists ( DataFlow:: SourceNode base | base .analyze ( ) .getAValue ( ) = function |
914901 result = base .getAPropertyRead ( "prototype" )
915902 or
916903 result = base .getAPropertySource ( "prototype" )
0 commit comments