@@ -370,11 +370,12 @@ ruleTester.run('no-mutating-props', rule, {
370370 <div v-if="this.prop6++ && this.someProp < 10"></div>
371371 <div v-text="this.prop7.shift()"></div>
372372 <div v-text="this.prop8.slice(0).shift()"></div>
373+ <div v-if="delete prop9.a"></div>
373374 </div>
374375 </template>
375376 <script>
376377 export default {
377- props: ['prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6', 'prop7', 'prop8']
378+ props: ['prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6', 'prop7', 'prop8', 'prop9' ]
378379 }
379380 </script>
380381 ` ,
@@ -402,6 +403,10 @@ ruleTester.run('no-mutating-props', rule, {
402403 {
403404 message : 'Unexpected mutation of "prop7" prop.' ,
404405 line : 10
406+ } ,
407+ {
408+ message : 'Unexpected mutation of "prop9" prop.' ,
409+ line : 12
405410 }
406411 ]
407412 } ,
@@ -507,6 +512,7 @@ ruleTester.run('no-mutating-props', rule, {
507512 ++this.items
508513 this.todo.type = 'completed'
509514 this.items.push('something')
515+ delete this.todo.type
510516 }
511517 }
512518 }
@@ -524,6 +530,10 @@ ruleTester.run('no-mutating-props', rule, {
524530 {
525531 message : 'Unexpected mutation of "items" prop.' ,
526532 line : 18
533+ } ,
534+ {
535+ message : 'Unexpected mutation of "todo" prop.' ,
536+ line : 19
527537 }
528538 ]
529539 } ,
@@ -651,6 +661,7 @@ ruleTester.run('no-mutating-props', rule, {
651661 props.a ++
652662 props.b = 1
653663 props.c.push(1)
664+ delete props.d
654665 }
655666 }
656667 </script>
@@ -667,6 +678,10 @@ ruleTester.run('no-mutating-props', rule, {
667678 {
668679 message : 'Unexpected mutation of "c" prop.' ,
669680 line : 7
681+ } ,
682+ {
683+ message : 'Unexpected mutation of "d" prop.' ,
684+ line : 8
670685 }
671686 ]
672687 } ,
@@ -681,6 +696,7 @@ ruleTester.run('no-mutating-props', rule, {
681696 c.push(1)
682697
683698 c.x.push(1)
699+ delete c.y
684700 e.foo++
685701 f.foo++
686702 }
@@ -705,12 +721,16 @@ ruleTester.run('no-mutating-props', rule, {
705721 line : 9
706722 } ,
707723 {
708- message : 'Unexpected mutation of "d " prop.' ,
724+ message : 'Unexpected mutation of "c " prop.' ,
709725 line : 10
710726 } ,
711727 {
712728 message : 'Unexpected mutation of "d" prop.' ,
713729 line : 11
730+ } ,
731+ {
732+ message : 'Unexpected mutation of "d" prop.' ,
733+ line : 12
714734 }
715735 ]
716736 } ,
@@ -722,6 +742,7 @@ ruleTester.run('no-mutating-props', rule, {
722742 export default {
723743 setup({a: foo, b: [...bar], c: baz = 1}) {
724744 foo.x ++
745+ delete foo.y
725746 bar.x = 1
726747 baz.push(1)
727748 }
@@ -734,12 +755,16 @@ ruleTester.run('no-mutating-props', rule, {
734755 line : 5
735756 } ,
736757 {
737- message : 'Unexpected mutation of "b " prop.' ,
758+ message : 'Unexpected mutation of "a " prop.' ,
738759 line : 6
739760 } ,
740761 {
741- message : 'Unexpected mutation of "c " prop.' ,
762+ message : 'Unexpected mutation of "b " prop.' ,
742763 line : 7
764+ } ,
765+ {
766+ message : 'Unexpected mutation of "c" prop.' ,
767+ line : 8
743768 }
744769 ]
745770 } ,
@@ -752,6 +777,7 @@ ruleTester.run('no-mutating-props', rule, {
752777 props.a ++
753778 props.b = 1
754779 props.c.push(1)
780+ delete props.d
755781 }
756782 }
757783 </script>
@@ -768,6 +794,10 @@ ruleTester.run('no-mutating-props', rule, {
768794 {
769795 message : 'Unexpected mutation of "c" prop.' ,
770796 line : 7
797+ } ,
798+ {
799+ message : 'Unexpected mutation of "d" prop.' ,
800+ line : 8
771801 }
772802 ]
773803 } ,
0 commit comments