@@ -58,11 +58,10 @@ module Vue {
58
58
}
59
59
60
60
private newtype TComponent =
61
- MkVueInstance ( API:: NewNode def ) { def = vueLibrary ( ) .getAnInstantiation ( ) } or
62
- MkExtendedVue ( VueExtendCall extend ) or
63
- MkExtendedInstance ( VueExtendCall extend , API:: NewNode sub ) {
64
- sub = extend .getReturn ( ) .getAnInstantiation ( )
61
+ MkComponentInstantiation ( API:: NewNode sub ) {
62
+ sub = component ( ) .getAnInstantiation ( )
65
63
} or
64
+ MkExtendedVue ( VueExtendCall extend ) or
66
65
MkComponentRegistration ( API:: CallNode def ) { def = vueLibrary ( ) .getMember ( "component" ) .getACall ( ) } or
67
66
MkSingleFileComponent ( VueFile file )
68
67
@@ -389,12 +388,12 @@ module Vue {
389
388
}
390
389
391
390
/**
392
- * A Vue component from `new Vue({...})`.
391
+ * A Vue component created implicitly at an invocation of form `new Vue({...})` or `new CustomComponent ({...})`.
393
392
*/
394
- class VueInstance extends Component , MkVueInstance {
393
+ private class ComponentInstantiation extends Component , MkComponentInstantiation {
395
394
API:: NewNode def ;
396
395
397
- VueInstance ( ) { this = MkVueInstance ( def ) }
396
+ ComponentInstantiation ( ) { this = MkComponentInstantiation ( def ) }
398
397
399
398
override string toString ( ) { result = def .toString ( ) }
400
399
@@ -411,6 +410,24 @@ module Vue {
411
410
override DataFlow:: Node getOwnOptionsObject ( ) { result = def .getArgument ( 0 ) }
412
411
413
412
override Template:: Element getTemplateElement ( ) { none ( ) }
413
+
414
+ override Component getABaseComponent ( ) {
415
+ result = Component .super .getABaseComponent ( )
416
+ or
417
+ result .getComponentRef ( ) .getAnInstantiation ( ) = def
418
+ }
419
+ }
420
+
421
+ /**
422
+ * DEPRECATED. Use `Vue::Component` instead.
423
+ *
424
+ * A Vue component from `new Vue({...})`.
425
+ */
426
+ deprecated class VueInstance extends Component {
427
+ VueInstance ( ) {
428
+ // restrict charpred to match original behavior
429
+ this = MkComponentInstantiation ( vueLibrary ( ) .getAnInstantiation ( ) )
430
+ }
414
431
}
415
432
416
433
/**
@@ -445,34 +462,14 @@ module Vue {
445
462
}
446
463
447
464
/**
465
+ * DEPRECATED. Use `Vue::Component` instead.
466
+ *
448
467
* An instance of an extended Vue, for example `instance` of `var Ext = Vue.extend({...}); var instance = new Ext({...})`.
449
468
*/
450
- class ExtendedInstance extends Component , MkExtendedInstance {
451
- VueExtendCall extend ;
452
- API:: NewNode sub ;
453
-
454
- ExtendedInstance ( ) { this = MkExtendedInstance ( extend , sub ) }
455
-
456
- override string toString ( ) { result = sub .toString ( ) }
457
-
458
- override predicate hasLocationInfo (
459
- string filepath , int startline , int startcolumn , int endline , int endcolumn
460
- ) {
461
- sub .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
462
- }
463
-
464
- override API:: Node getComponentRef ( ) { result = sub .getReturn ( ) }
465
-
466
- override API:: Node getOwnOptions ( ) { result = sub .getParameter ( 0 ) }
467
-
468
- override DataFlow:: Node getOwnOptionsObject ( ) { result = sub .getArgument ( 0 ) }
469
-
470
- override Template:: Element getTemplateElement ( ) { none ( ) }
471
-
472
- override Component getABaseComponent ( ) {
473
- result = Component .super .getABaseComponent ( )
474
- or
475
- result .getComponentRef ( ) .getAnInstantiation ( ) = sub
469
+ deprecated class ExtendedInstance extends Component {
470
+ ExtendedInstance ( ) {
471
+ // restrict charpred to match original behavior
472
+ this = MkComponentInstantiation ( vueLibrary ( ) .getMember ( "extend" ) .getReturn ( ) .getAnInstantiation ( ) )
476
473
}
477
474
}
478
475
0 commit comments