@@ -116,9 +116,9 @@ module Vuex {
116
116
/** Gets the name of the `vuex` method being invoked, such as `mapGetters`. */
117
117
string getHelperName ( ) { result = helperName }
118
118
119
- /** Gets the namespace prefix provided via the first argument, if any . */
119
+ /** Gets the namespace prefix to use, or an empty string if no namespace was given . */
120
120
pragma [ noinline]
121
- string getPrefix ( ) {
121
+ string getNamespace ( ) {
122
122
getNumArgument ( ) = 2 and
123
123
result = namespace + getParameter ( 0 ) .getAValueReachingRhs ( ) .getStringValue ( ) + "/"
124
124
or
@@ -132,15 +132,15 @@ module Vuex {
132
132
predicate hasMapping ( string localName , string storeName ) {
133
133
// mapGetters('foo')
134
134
getLastParameter ( ) .getAValueReachingRhs ( ) .getStringValue ( ) = localName and
135
- storeName = getPrefix ( ) + localName
135
+ storeName = getNamespace ( ) + localName
136
136
or
137
137
// mapGetters(['foo', 'bar'])
138
138
getLastParameter ( ) .getUnknownMember ( ) .getAValueReachingRhs ( ) .getStringValue ( ) = localName and
139
- storeName = getPrefix ( ) + localName
139
+ storeName = getNamespace ( ) + localName
140
140
or
141
141
// mapGetters({foo: 'bar'})
142
142
storeName =
143
- getPrefix ( ) +
143
+ getNamespace ( ) +
144
144
getLastParameter ( ) .getMember ( localName ) .getAValueReachingRhs ( ) .getStringValue ( ) and
145
145
localName != "*" // ignore special API graph member named "*"
146
146
}
@@ -220,7 +220,7 @@ module Vuex {
220
220
exists ( MapHelperCall mapMutations |
221
221
mapMutations .getHelperName ( ) = "mapMutations" and
222
222
result = mapMutations .getLastParameter ( ) .getAMember ( ) .getParameter ( 0 ) and
223
- prefix = mapMutations .getPrefix ( )
223
+ prefix = mapMutations .getNamespace ( )
224
224
)
225
225
}
226
226
@@ -314,7 +314,7 @@ module Vuex {
314
314
exists ( MapHelperCall call |
315
315
call .getHelperName ( ) = "mapState" and
316
316
result = call .getLastParameter ( ) .getAMember ( ) .getParameter ( 0 ) and
317
- path = call .getPrefix ( )
317
+ path = call .getNamespace ( )
318
318
)
319
319
or
320
320
exists ( string base , string prop |
0 commit comments