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 {
15
15
16
16
ObjectProperty getProp ( int i ) { result = ObjectImpl .super .getProperty ( i ) }
17
17
18
+ /**
19
+ * Get the value of a property by its name.
20
+ */
18
21
Expr getProperty ( string name ) {
19
22
exists ( ObjectProperty property |
20
23
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
+ )
22
29
|
23
30
result = property .getValue ( )
24
31
)
@@ -29,7 +36,7 @@ class Object extends Expr instanceof ObjectImpl {
29
36
* A ObjectProperty unknown AST node.
30
37
*/
31
38
class ObjectProperty extends Expr instanceof ObjectPropertyImpl {
32
- Idents getName ( ) { result = ObjectPropertyImpl .super .getName ( ) }
39
+ Expr getName ( ) { result = ObjectPropertyImpl .super .getName ( ) }
33
40
34
41
Expr getValue ( ) { result = ObjectPropertyImpl .super .getValue ( ) }
35
42
}
@@ -87,9 +94,7 @@ class Resource extends TResource {
87
94
exists ( StringLiteral sl | sl = resource .getName ( ) | result = sl .getValue ( ) )
88
95
}
89
96
90
- Identifier getIdentifier ( ) {
91
- result = resource .getIdentifier ( )
92
- }
97
+ Identifier getIdentifier ( ) { result = resource .getIdentifier ( ) }
93
98
94
99
string getName ( ) {
95
100
exists ( StringLiteral name |
You can’t perform that action at this time.
0 commit comments