@@ -228,7 +228,9 @@ module Vue {
228
228
* extended objects and mixins.
229
229
*/
230
230
pragma [ nomagic]
231
- DataFlow:: SourceNode getOptionSource ( string name ) { result = getOption ( name ) .getALocalSource ( ) }
231
+ DataFlow:: SourceNode getOptionSource ( string name ) {
232
+ result = getOptions ( ) .getMember ( name ) .getAValueReachingRhs ( )
233
+ }
232
234
233
235
/**
234
236
* Gets the template element used by this component, if any.
@@ -239,15 +241,9 @@ module Vue {
239
241
* Gets the node for the `data` option object of this component.
240
242
*/
241
243
DataFlow:: Node getData ( ) {
242
- exists ( DataFlow:: Node data | data = getOption ( "data" ) |
243
- result = data
244
- or
245
- // a constructor variant is available for all component definitions
246
- exists ( DataFlow:: FunctionNode f |
247
- f .flowsTo ( data ) and
248
- result = f .getAReturn ( )
249
- )
250
- )
244
+ result = getOption ( "data" )
245
+ or
246
+ result = getOptionSource ( "data" ) .( DataFlow:: FunctionNode ) .getReturnNode ( )
251
247
or
252
248
result = getAsClassComponent ( ) .getAReceiverNode ( )
253
249
or
@@ -292,10 +288,9 @@ module Vue {
292
288
* Gets the function responding to changes to the given `propName`.
293
289
*/
294
290
DataFlow:: FunctionNode getWatchHandler ( string propName ) {
295
- exists ( DataFlow:: SourceNode watcher | watcher = getWatch ( ) .getAPropertySource ( propName ) |
296
- result = watcher
297
- or
298
- result = watcher .getAPropertySource ( "handler" )
291
+ exists ( API:: Node propWatch |
292
+ propWatch = getOptions ( ) .getMember ( "watch" ) .getMember ( propName ) and
293
+ result = [ propWatch , propWatch .getMember ( "handler" ) ] .getAValueReachingRhs ( )
299
294
)
300
295
}
301
296
0 commit comments