File tree 5 files changed +14
-9
lines changed
5 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 145
145
this . _prepBehaviors ( ) ;
146
146
this . _prepConfigure ( ) ;
147
147
this . _prepBindings ( ) ;
148
+ this . _prepPropertyInfo ( ) ;
148
149
Polymer . Base . _initFeatures . call ( this ) ;
149
150
this . _children = Array . prototype . slice . call ( this . root . childNodes ) ;
150
151
}
Original file line number Diff line number Diff line change 117
117
this . _customPrepEffects ( archetype ) ;
118
118
archetype . _prepBehaviors ( ) ;
119
119
archetype . _prepBindings ( ) ;
120
+ archetype . _prepPropertyInfo ( ) ;
120
121
121
122
// boilerplate code
122
123
archetype . _notifyPathUp = this . _notifyPathUpImpl ;
Original file line number Diff line number Diff line change 104
104
if ( ! this . _serializing ) {
105
105
var property = property || Polymer . CaseMap . dashToCamelCase ( attribute ) ;
106
106
// fallback to property lookup
107
- info = info || this . _propertyInfo [ property ] ;
107
+ info = info || ( this . _propertyInfo && this . _propertyInfo [ property ] ) ;
108
108
if ( info && ! info . readOnly ) {
109
109
var v = this . getAttribute ( attribute ) ;
110
- // TODO(sorvell): maybe not kosher but under current rules,
111
- // we can avoid deserializing null values for non-Boolean types.
112
- if ( v !== null || info . type === Boolean ) {
113
- model [ property ] = this . deserialize ( v , info . type ) ;
114
- }
110
+ model [ property ] = this . deserialize ( v , info . type ) ;
115
111
}
116
112
}
117
113
} ,
Original file line number Diff line number Diff line change 146
146
for ( var i in source ) {
147
147
t = target [ i ] ;
148
148
s = source [ i ] ;
149
+ // optimization: avoid info'ing properties that are protected and
150
+ // not read only since they are not needed for attributes or
151
+ // configuration.
152
+ if ( i . indexOf ( '_' ) === 0 && ! s . readOnly ) {
153
+ continue ;
154
+ }
149
155
if ( ! target [ i ] ) {
150
156
target [ i ] = t = typeof ( s ) === 'function' ? { type : s } : s ;
151
157
t . attribute = Polymer . CaseMap . camelToDashCase ( i ) ;
Original file line number Diff line number Diff line change 125
125
//if (!this.getPropertyInfo(prop).readOnly) {
126
126
// TODO(sorvell): tempatized things don't have _propertyInfo atm
127
127
// so fallback to property lookup.
128
- var info = this . _propertyInfo && this . _propertyInfo [ prop ] ||
129
- this . getPropertyInfo ( prop ) ;
130
- if ( ! info . readOnly ) {
128
+ // var info = this._propertyInfo && this._propertyInfo[prop] ||
129
+ // this.getPropertyInfo(prop);
130
+ var info = this . _propertyInfo [ prop ] ;
131
+ if ( ! info || ! info . readOnly ) {
131
132
a [ prop ] = b [ prop ] ;
132
133
}
133
134
}
You can’t perform that action at this time.
0 commit comments