File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,17 @@ class Object extends Expr instanceof ObjectImpl {
1515
1616 ObjectProperty getProp ( int i ) { result = ObjectImpl .super .getProperty ( i ) }
1717
18+ /**
19+ * Get the value of a property by its name.
20+ */
1821 Expr getProperty ( string name ) {
1922 exists ( ObjectProperty property |
2023 property = this .getProperties ( ) and
21- property .getName ( ) .getName ( ) = name
24+ (
25+ exists ( Idents ident | ident = property .getName ( ) | ident .getName ( ) = name )
26+ or
27+ exists ( StringLiteral str | str = property .getName ( ) | str .getValue ( ) = name )
28+ )
2229 |
2330 result = property .getValue ( )
2431 )
@@ -29,7 +36,7 @@ class Object extends Expr instanceof ObjectImpl {
2936 * A ObjectProperty unknown AST node.
3037 */
3138class ObjectProperty extends Expr instanceof ObjectPropertyImpl {
32- Idents getName ( ) { result = ObjectPropertyImpl .super .getName ( ) }
39+ Expr getName ( ) { result = ObjectPropertyImpl .super .getName ( ) }
3340
3441 Expr getValue ( ) { result = ObjectPropertyImpl .super .getValue ( ) }
3542}
@@ -87,9 +94,7 @@ class Resource extends TResource {
8794 exists ( StringLiteral sl | sl = resource .getName ( ) | result = sl .getValue ( ) )
8895 }
8996
90- Identifier getIdentifier ( ) {
91- result = resource .getIdentifier ( )
92- }
97+ Identifier getIdentifier ( ) { result = resource .getIdentifier ( ) }
9398
9499 string getName ( ) {
95100 exists ( StringLiteral name |
You can’t perform that action at this time.
0 commit comments