File tree 2 files changed +31
-1
lines changed
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 120
120
// to override default values. This allows late upgrade + an early set
121
121
// to not b0rk accessors on the prototype.
122
122
// Perf testing has shown `hasOwnProperty` to be ok here.
123
- if ( ! usePolyfillProto && this . hasOwnProperty ( i ) ) {
123
+ if ( ! usePolyfillProto && this . hasOwnProperty ( i ) &&
124
+ this . _propertyEffects && this . _propertyEffects [ i ] ) {
124
125
config [ i ] = this [ i ] ;
125
126
delete this [ i ] ;
126
127
} else if ( c . value !== undefined ) {
Original file line number Diff line number Diff line change 133
133
assert . equal ( x . shouldChange , x . textContent ) ;
134
134
document . body . removeChild ( x ) ;
135
135
} ) ;
136
+
137
+ test ( 'setting properties in created works with configuration' , function ( ) {
138
+ // don't test if __proto__ is polyfilled (IE10); cannot be fixed in this case.
139
+ if ( Polymer . Settings . usePolyfillProto ) {
140
+ return ;
141
+ }
142
+ var x = document . createElement ( 'x-late-register2' ) ;
143
+ document . body . appendChild ( x ) ;
144
+ // now register element
145
+ Polymer ( {
146
+ is : 'x-late-register2' ,
147
+ properties : {
148
+ a : {
149
+ type : Number
150
+ } ,
151
+ b : {
152
+ value : function ( ) {
153
+ return this . a * 2 ;
154
+ }
155
+ }
156
+ } ,
157
+ created : function ( ) {
158
+ this . a = 1 ;
159
+ }
160
+ } ) ;
161
+ CustomElements . takeRecords ( ) ;
162
+ assert . equal ( x . b , 2 ) ;
163
+ document . body . removeChild ( x ) ;
164
+ } ) ;
136
165
} ) ;
137
166
138
167
</ script >
You can’t perform that action at this time.
0 commit comments