File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 114114 _configureProperties : function ( properties , config ) {
115115 for ( var i in properties ) {
116116 var c = properties [ i ] ;
117- // don't accept undefined values
118- if ( c . value !== undefined ) {
117+ if ( this [ i ] !== undefined ) {
118+ config [ i ] = this [ i ] ;
119+ delete this [ i ] ;
120+ } else if ( c . value !== undefined ) {
119121 var value = c . value ;
120122 if ( typeof value == 'function' ) {
121123 // pass existing config values (this._config) to value function
Original file line number Diff line number Diff line change 164164
165165 } ) ;
166166 </ script >
167- </ dom-module >
167+ </ dom-module >
168+
169+ < script >
170+ Polymer ( {
171+ is : 'x-configure-internal' ,
172+ properties : {
173+ shouldChange : {
174+ observer : 'shouldChangeCallback' ,
175+ type : String
176+ }
177+ } ,
178+ shouldChangeCallback : function ( ) {
179+ this . innerHTML = this . shouldChange ;
180+ }
181+ } ) ;
182+ </ script >
183+ < script >
184+ Polymer ( {
185+ is : 'x-configure-external' ,
186+ ready : function ( ) {
187+ var e = this . querySelector ( 'x-configure-internal' ) ;
188+ e . shouldChange = 'It works' ;
189+ }
190+ } ) ;
191+ </ script >
Original file line number Diff line number Diff line change 2626
2727 < x-configure-host content ="attr "> </ x-configure-host >
2828
29+ < x-configure-external >
30+ < x-configure-internal > </ x-configure-internal >
31+ </ x-configure-external >
32+
2933< script >
3034
3135 function testValueAndChangeHandler ( e , value ) {
8791 assert . equal ( e . $ . child . attr , undefined ) ;
8892 } ) ;
8993
94+ test ( 'direct property assignment overrides getters and setters' , function ( ) {
95+ var e = document . querySelector ( 'x-configure-internal' ) ;
96+ assert . equal ( e . innerHTML , 'It works' ) ;
97+ } ) ;
9098 } ) ;
9199
92100</ script >
You can’t perform that action at this time.
0 commit comments