File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,36 @@ describe('vue-class-component', () => {
401
401
expect ( vm . valueB ) . to . equal ( 456 )
402
402
} )
403
403
404
+ it ( 'mixins should be safe with VueContructor and global mixins' , function ( ) {
405
+ let counter = 0
406
+
407
+ /**
408
+ * dangerous global mixin
409
+ */
410
+ Vue . mixin ( {
411
+ created ( ) {
412
+ counter ++
413
+ }
414
+ } )
415
+
416
+ @Component
417
+ class MixinA extends Vue {
418
+ }
419
+
420
+ @Component
421
+ class MixinB extends Vue {
422
+ }
423
+
424
+ @Component
425
+ class MyComp extends mixins ( MixinA , MixinB ) {
426
+ test ( ) { }
427
+ }
428
+
429
+ const vm = new MyComp ( )
430
+ vm . test ( ) // just to avoid 'noUnusedLocals' error
431
+ expect ( counter ) . to . equal ( 0 )
432
+ } )
433
+
404
434
it ( 'copies reflection metadata' , function ( ) {
405
435
@Component
406
436
@Reflect . metadata ( 'worksConstructor' , true )
You can’t perform that action at this time.
0 commit comments