@@ -190,25 +190,27 @@ module Vue {
190
190
}
191
191
192
192
/**
193
+ * DEPRECATED. Use `getOwnOptions().getARhs()`.
194
+ *
193
195
* Gets the options passed to the Vue object, such as the object literal `{...}` in `new Vue{{...})`
194
196
* or the default export of a single-file component.
195
197
*/
196
- DataFlow:: Node getOwnOptionsObject ( ) { none ( ) } // overridden in subclasses
198
+ deprecated DataFlow:: Node getOwnOptionsObject ( ) { none ( ) } // overridden in subclasses
197
199
198
200
/**
199
201
* Gets the class implementing this Vue component, if any.
200
202
*
201
203
* Specifically, this is a class annotated with `@Component` which flows to the options
202
204
* object of this Vue component.
203
205
*/
204
- ClassComponent getAsClassComponent ( ) { result . flowsTo ( getOwnOptionsObject ( ) ) }
206
+ ClassComponent getAsClassComponent ( ) { result = getOwnOptions ( ) . getAValueReachingRhs ( ) }
205
207
206
208
/**
207
209
* Gets the node for option `name` for this component, not including
208
210
* those from extended objects and mixins.
209
211
*/
210
212
DataFlow:: Node getOwnOption ( string name ) {
211
- result = getOwnOptionsObject ( ) .getALocalSource ( ) . getAPropertyWrite ( name ) .getRhs ( )
213
+ result = getOwnOptions ( ) .getMember ( name ) .getARhs ( )
212
214
}
213
215
214
216
/**
@@ -378,8 +380,6 @@ module Vue {
378
380
379
381
override API:: Node getOwnOptions ( ) { result = def .getParameter ( 0 ) }
380
382
381
- override DataFlow:: Node getOwnOptionsObject ( ) { result = def .getArgument ( 0 ) }
382
-
383
383
override Template:: Element getTemplateElement ( ) { none ( ) }
384
384
385
385
override Component getABaseComponent ( ) {
@@ -426,8 +426,6 @@ module Vue {
426
426
427
427
override API:: Node getOwnOptions ( ) { result = extend .getParameter ( 0 ) }
428
428
429
- override DataFlow:: Node getOwnOptionsObject ( ) { result = extend .getArgument ( 0 ) }
430
-
431
429
override Template:: Element getTemplateElement ( ) { none ( ) }
432
430
433
431
override Component getABaseComponent ( ) {
@@ -473,8 +471,6 @@ module Vue {
473
471
474
472
override API:: Node getOwnOptions ( ) { result = def .getParameter ( 1 ) }
475
473
476
- override DataFlow:: Node getOwnOptionsObject ( ) { result = def .getArgument ( 1 ) }
477
-
478
474
override Template:: Element getTemplateElement ( ) { none ( ) }
479
475
}
480
476
@@ -547,34 +543,6 @@ module Vue {
547
543
result .getARhs ( ) = getModule ( ) .getDefaultOrBulkExport ( )
548
544
}
549
545
550
- override DataFlow:: Node getOwnOptionsObject ( ) {
551
- exists ( ExportDefaultDeclaration decl |
552
- decl .getTopLevel ( ) = getModule ( ) and
553
- result = DataFlow:: valueNode ( decl .getOperand ( ) )
554
- )
555
- }
556
-
557
- override DataFlow:: Node getOwnOption ( string name ) {
558
- // The options of a single file component are defined by the exported object of the script element.
559
- // Our current module model does not support reads on this object very well, so we use custom steps for the common cases for now.
560
- exists ( Module m , DefiniteAbstractValue abstractOptions |
561
- any ( AnalyzedPropertyWrite write ) .writes ( abstractOptions , name , result ) and
562
- m = getModule ( )
563
- |
564
- // ES2015 exports
565
- exists ( ExportDeclaration export , DataFlow:: AnalyzedNode exported |
566
- export .getEnclosingModule ( ) = m and
567
- abstractOptions = exported .getAValue ( )
568
- |
569
- exported = export .( BulkReExportDeclaration ) .getSourceNode ( "default" ) or
570
- exported .asExpr ( ) = export .( ExportDefaultDeclaration ) .getOperand ( )
571
- )
572
- or
573
- // Node.js exports
574
- abstractOptions = m .( NodeModule ) .getAModuleExportsValue ( )
575
- )
576
- }
577
-
578
546
override string toString ( ) { result = file .toString ( ) }
579
547
}
580
548
0 commit comments