@@ -161,6 +161,23 @@ module Vue {
161
161
*/
162
162
API:: Node getOwnOptions ( ) { none ( ) } // overridden in subclass
163
163
164
+ /** Gets a component which is extended by this one. */
165
+ Component getABaseComponent ( ) {
166
+ result .getComponentRef ( ) .getAUse ( ) = getOwnOptions ( ) .getMember ( [ "extends" , "mixins" ] ) .getARhs ( )
167
+ }
168
+
169
+ /**
170
+ * Gets an API node referring to the options passed to the Vue object or one
171
+ * of its base component.
172
+ */
173
+ API:: Node getOptions ( ) {
174
+ result = getOwnOptions ( )
175
+ or
176
+ result = getOwnOptions ( ) .getMember ( [ "extends" , "mixins" ] ) .getAMember ( )
177
+ or
178
+ result = getABaseComponent ( ) .getOptions ( )
179
+ }
180
+
164
181
/**
165
182
* Gets the options passed to the Vue object, such as the object literal `{...}` in `new Vue{{...})`
166
183
* or the default export of a single-file component.
@@ -188,23 +205,9 @@ module Vue {
188
205
* extended objects and mixins.
189
206
*/
190
207
DataFlow:: Node getOption ( string name ) {
191
- result = getOwnOption ( name )
192
- or
193
- exists ( DataFlow:: SourceNode extendsVal | extendsVal .flowsTo ( getOwnOption ( "extends" ) ) |
194
- result = extendsVal .( DataFlow:: ObjectLiteralNode ) .getAPropertyWrite ( name ) .getRhs ( )
195
- or
196
- exists ( ExtendedVue extend |
197
- MkExtendedVue ( extendsVal ) = extend and
198
- result = extend .getOption ( name )
199
- )
200
- )
201
- or
202
- exists ( DataFlow:: ArrayCreationNode mixins , DataFlow:: ObjectLiteralNode mixin |
203
- mixins .flowsTo ( getOwnOption ( "mixins" ) ) and
204
- mixin .flowsTo ( mixins .getAnElement ( ) ) and
205
- result = mixin .getAPropertyWrite ( name ) .getRhs ( )
206
- )
208
+ result = getOptions ( ) .getMember ( name ) .getARhs ( )
207
209
or
210
+ // not ported to API graphs yet
208
211
result = getAsClassComponent ( ) .getDecoratorOption ( name )
209
212
}
210
213
0 commit comments