@@ -116,9 +116,9 @@ module Vuex {
116116 /** Gets the name of the `vuex` method being invoked, such as `mapGetters`. */
117117 string getHelperName ( ) { result = helperName }
118118
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 . */
120120 pragma [ noinline]
121- string getPrefix ( ) {
121+ string getNamespace ( ) {
122122 getNumArgument ( ) = 2 and
123123 result = namespace + getParameter ( 0 ) .getAValueReachingRhs ( ) .getStringValue ( ) + "/"
124124 or
@@ -132,15 +132,15 @@ module Vuex {
132132 predicate hasMapping ( string localName , string storeName ) {
133133 // mapGetters('foo')
134134 getLastParameter ( ) .getAValueReachingRhs ( ) .getStringValue ( ) = localName and
135- storeName = getPrefix ( ) + localName
135+ storeName = getNamespace ( ) + localName
136136 or
137137 // mapGetters(['foo', 'bar'])
138138 getLastParameter ( ) .getUnknownMember ( ) .getAValueReachingRhs ( ) .getStringValue ( ) = localName and
139- storeName = getPrefix ( ) + localName
139+ storeName = getNamespace ( ) + localName
140140 or
141141 // mapGetters({foo: 'bar'})
142142 storeName =
143- getPrefix ( ) +
143+ getNamespace ( ) +
144144 getLastParameter ( ) .getMember ( localName ) .getAValueReachingRhs ( ) .getStringValue ( ) and
145145 localName != "*" // ignore special API graph member named "*"
146146 }
@@ -220,7 +220,7 @@ module Vuex {
220220 exists ( MapHelperCall mapMutations |
221221 mapMutations .getHelperName ( ) = "mapMutations" and
222222 result = mapMutations .getLastParameter ( ) .getAMember ( ) .getParameter ( 0 ) and
223- prefix = mapMutations .getPrefix ( )
223+ prefix = mapMutations .getNamespace ( )
224224 )
225225 }
226226
@@ -314,7 +314,7 @@ module Vuex {
314314 exists ( MapHelperCall call |
315315 call .getHelperName ( ) = "mapState" and
316316 result = call .getLastParameter ( ) .getAMember ( ) .getParameter ( 0 ) and
317- path = call .getPrefix ( )
317+ path = call .getNamespace ( )
318318 )
319319 or
320320 exists ( string base , string prop |
0 commit comments