88import { ENV } from '@ember/-internals/environment' ;
99import { Component , setComponentManager } from '@ember/-internals/glimmer' ;
1010import type { InternalOwner } from '@ember/-internals/owner' ;
11+ import { set } from '@ember/object' ;
1112import Route from '@ember/routing/route' ;
1213import Controller from '@ember/controller' ;
1314import { assert , captureRenderTree } from '@ember/debug' ;
@@ -313,7 +314,8 @@ if (ENV._DEBUG_RENDER_TREE) {
313314 ] ) ;
314315
315316 runTask ( ( ) => {
316- this . controllerFor ( 'application' ) ! . set ( 'engineName' , 'bar' ) ;
317+ const controller = this . controllerFor ( 'application' ) ! ;
318+ set ( controller , 'engineName' , 'bar' ) ;
317319 } ) ;
318320
319321 this . assertRenderTree ( [
@@ -362,7 +364,8 @@ if (ENV._DEBUG_RENDER_TREE) {
362364 ] ) ;
363365
364366 runTask ( ( ) => {
365- this . controllerFor ( 'application' ) ! . set ( 'engineName' , undefined ) ;
367+ const controller = this . controllerFor ( 'application' ) ! ;
368+ set ( controller , 'engineName' , undefined ) ;
366369 } ) ;
367370
368371 this . assertRenderTree ( [
@@ -396,10 +399,9 @@ if (ENV._DEBUG_RENDER_TREE) {
396399 } ;
397400
398401 runTask ( ( ) => {
399- this . controllerFor ( 'application' ) ! . setProperties ( {
400- showMore : true ,
401- engineModel : model ,
402- } ) ;
402+ const controller = this . controllerFor ( 'application' ) ! ;
403+ set ( controller , 'showMore' , true ) ;
404+ set ( controller , 'engineModel' , model ) ;
403405 } ) ;
404406
405407 this . assertRenderTree ( [
@@ -458,7 +460,8 @@ if (ENV._DEBUG_RENDER_TREE) {
458460 ] ) ;
459461
460462 runTask ( ( ) => {
461- this . controllerFor ( 'application' ) ! . set ( 'engineName' , 'bar' ) ;
463+ const controller = this . controllerFor ( 'application' ) ! ;
464+ set ( controller , 'engineName' , 'bar' ) ;
462465 } ) ;
463466
464467 this . assertRenderTree ( [
@@ -569,10 +572,9 @@ if (ENV._DEBUG_RENDER_TREE) {
569572 ] ) ;
570573
571574 runTask ( ( ) => {
572- this . controllerFor ( 'application' ) ! . setProperties ( {
573- showMore : false ,
574- engineName : undefined ,
575- } ) ;
575+ const controller = this . controllerFor ( 'application' ) ! ;
576+ set ( controller , 'showMore' , false ) ;
577+ set ( controller , 'engineName' , undefined ) ;
576578 } ) ;
577579
578580 this . assertRenderTree ( [
@@ -720,7 +722,7 @@ if (ENV._DEBUG_RENDER_TREE) {
720722 runTask ( ( ) => {
721723 let controller = instance ! . lookup ( 'controller:application' ) ;
722724 assert ( 'Expected an instance of controller' , controller instanceof Controller ) ;
723- controller . set ( 'message' , 'World' ) ;
725+ set ( controller , 'message' , 'World' ) ;
724726 } ) ;
725727
726728 this . assertRenderTree ( [
@@ -776,7 +778,7 @@ if (ENV._DEBUG_RENDER_TREE) {
776778 runTask ( ( ) => {
777779 let controller = instance ! . lookup ( 'controller:application' ) ;
778780 assert ( 'Expected an instance of controller' , controller instanceof Controller ) ;
779- controller . set ( 'message' , undefined ) ;
781+ set ( controller , 'message' , undefined ) ;
780782 } ) ;
781783
782784 this . assertRenderTree ( [
@@ -870,7 +872,8 @@ if (ENV._DEBUG_RENDER_TREE) {
870872 ] ) ;
871873
872874 runTask ( ( ) => {
873- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
875+ const controller = this . controllerFor ( 'application' ) ! ;
876+ set ( controller , 'showSecond' , true ) ;
874877 } ) ;
875878
876879 this . assertRenderTree ( [
@@ -895,7 +898,8 @@ if (ENV._DEBUG_RENDER_TREE) {
895898 ] ) ;
896899
897900 runTask ( ( ) => {
898- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
901+ const controller = this . controllerFor ( 'application' ) ! ;
902+ set ( controller , 'showSecond' , false ) ;
899903 } ) ;
900904
901905 this . assertRenderTree ( [
@@ -943,7 +947,8 @@ if (ENV._DEBUG_RENDER_TREE) {
943947 ] ) ;
944948
945949 runTask ( ( ) => {
946- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
950+ const controller = this . controllerFor ( 'application' ) ! ;
951+ set ( controller , 'showSecond' , true ) ;
947952 } ) ;
948953
949954 this . assertRenderTree ( [
@@ -968,7 +973,8 @@ if (ENV._DEBUG_RENDER_TREE) {
968973 ] ) ;
969974
970975 runTask ( ( ) => {
971- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
976+ const controller = this . controllerFor ( 'application' ) ! ;
977+ set ( controller , 'showSecond' , false ) ;
972978 } ) ;
973979
974980 this . assertRenderTree ( [
@@ -1018,7 +1024,8 @@ if (ENV._DEBUG_RENDER_TREE) {
10181024 ] ) ;
10191025
10201026 runTask ( ( ) => {
1021- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
1027+ const controller = this . controllerFor ( 'application' ) ! ;
1028+ set ( controller , 'showSecond' , true ) ;
10221029 } ) ;
10231030
10241031 this . assertRenderTree ( [
@@ -1043,7 +1050,8 @@ if (ENV._DEBUG_RENDER_TREE) {
10431050 ] ) ;
10441051
10451052 runTask ( ( ) => {
1046- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
1053+ const controller = this . controllerFor ( 'application' ) ! ;
1054+ set ( controller , 'showSecond' , false ) ;
10471055 } ) ;
10481056
10491057 this . assertRenderTree ( [
@@ -1091,7 +1099,8 @@ if (ENV._DEBUG_RENDER_TREE) {
10911099 ] ) ;
10921100
10931101 runTask ( ( ) => {
1094- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
1102+ const controller = this . controllerFor ( 'application' ) ! ;
1103+ set ( controller , 'showSecond' , true ) ;
10951104 } ) ;
10961105
10971106 this . assertRenderTree ( [
@@ -1116,7 +1125,8 @@ if (ENV._DEBUG_RENDER_TREE) {
11161125 ] ) ;
11171126
11181127 runTask ( ( ) => {
1119- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
1128+ const controller = this . controllerFor ( 'application' ) ! ;
1129+ set ( controller , 'showSecond' , false ) ;
11201130 } ) ;
11211131
11221132 this . assertRenderTree ( [
@@ -1176,7 +1186,8 @@ if (ENV._DEBUG_RENDER_TREE) {
11761186 ] ) ;
11771187
11781188 runTask ( ( ) => {
1179- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
1189+ const controller = this . controllerFor ( 'application' ) ! ;
1190+ set ( controller , 'showSecond' , true ) ;
11801191 } ) ;
11811192
11821193 this . assertRenderTree ( [
@@ -1201,7 +1212,8 @@ if (ENV._DEBUG_RENDER_TREE) {
12011212 ] ) ;
12021213
12031214 runTask ( ( ) => {
1204- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
1215+ const controller = this . controllerFor ( 'application' ) ! ;
1216+ set ( controller , 'showSecond' , false ) ;
12051217 } ) ;
12061218
12071219 this . assertRenderTree ( [
@@ -1295,7 +1307,7 @@ if (ENV._DEBUG_RENDER_TREE) {
12951307 } ,
12961308 ] ) ;
12971309
1298- runTask ( ( ) => target . set ( 'showSecond' , true ) ) ;
1310+ runTask ( ( ) => set ( target , 'showSecond' , true ) ) ;
12991311
13001312 const secondModifiers : ExpectedRenderNode [ 'children' ] = [
13011313 {
@@ -1366,7 +1378,7 @@ if (ENV._DEBUG_RENDER_TREE) {
13661378 } ,
13671379 ] ) ;
13681380
1369- runTask ( ( ) => target . set ( 'showSecond' , false ) ) ;
1381+ runTask ( ( ) => set ( target , 'showSecond' , false ) ) ;
13701382
13711383 this . assertRenderTree ( [
13721384 {
@@ -1462,7 +1474,8 @@ if (ENV._DEBUG_RENDER_TREE) {
14621474 this . assertRenderTree ( [ textareaNode ( 'first' , this . element ! . firstChild , firstModifiers ) ] ) ;
14631475
14641476 runTask ( ( ) => {
1465- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
1477+ const controller = this . controllerFor ( 'application' ) ! ;
1478+ set ( controller , 'showSecond' , true ) ;
14661479 } ) ;
14671480
14681481 const secondModifiers : ExpectedRenderNode [ 'children' ] = [
@@ -1519,7 +1532,8 @@ if (ENV._DEBUG_RENDER_TREE) {
15191532 ] ) ;
15201533
15211534 runTask ( ( ) => {
1522- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
1535+ const controller = this . controllerFor ( 'application' ) ! ;
1536+ set ( controller , 'showSecond' , false ) ;
15231537 } ) ;
15241538
15251539 this . assertRenderTree ( [ textareaNode ( 'first' , this . element ! . firstChild , firstModifiers ) ] ) ;
@@ -1571,7 +1585,8 @@ if (ENV._DEBUG_RENDER_TREE) {
15711585 ] ) ;
15721586
15731587 runTask ( ( ) => {
1574- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , true ) ;
1588+ const controller = this . controllerFor ( 'application' ) ! ;
1589+ set ( controller , 'showSecond' , true ) ;
15751590 } ) ;
15761591
15771592 const secondModifiers : ExpectedRenderNode [ 'children' ] = [
@@ -1608,7 +1623,8 @@ if (ENV._DEBUG_RENDER_TREE) {
16081623 ] ) ;
16091624
16101625 runTask ( ( ) => {
1611- this . controllerFor ( 'application' ) ! . set ( 'showSecond' , false ) ;
1626+ const controller = this . controllerFor ( 'application' ) ! ;
1627+ set ( controller , 'showSecond' , false ) ;
16121628 } ) ;
16131629
16141630 this . assertRenderTree ( [
0 commit comments