@@ -201,7 +201,6 @@ registry.object = class extends ProxyProperty {
201201 }` ;
202202 } ) . join ( '\n' )
203203 }
204- this[SetWithDefaults](property.defaultValue);
205204 }
206205 [Set](value) {
207206 if (!value) return;
@@ -215,16 +214,39 @@ registry.object = class extends ProxyProperty {
215214 if (value) {
216215 ${
217216 Object . keys ( properties ) . map ( ( key ) => `{
218- this['${ key } '] = '${ key } ' in value
219- ? value['${ key } ']
220- : properties['${ key } '].defaultValue;
217+ let localValue;
218+ if ('${ key } ' in value) {
219+ localValue = value['${ key } '];
220+ }
221+ else if (property.defaultValue && '${ key } ' in property.defaultValue) {
222+ localValue = property.defaultValue['${ key } '];
223+ }
224+ else {
225+ localValue = properties['${ key } '].defaultValue;
226+ }
227+ ${
228+ properties [ key ] instanceof ProxyProperty
229+ ? `this['${ key } '][SetWithDefaults](localValue);`
230+ : `this['${ key } '] = localValue;`
231+ }
221232 }` ) . join ( '\n' )
222233 }
223234 }
224235 else {
225236 ${
226237 Object . keys ( properties ) . map ( ( key ) => `{
227- this['${ key } '] = properties['${ key } '].defaultValue;
238+ let localValue;
239+ if (property.defaultValue && '${ key } ' in property.defaultValue) {
240+ localValue = property.defaultValue['${ key } '];
241+ }
242+ else {
243+ localValue = properties['${ key } '].defaultValue;
244+ }
245+ ${
246+ properties [ key ] instanceof ProxyProperty
247+ ? `this['${ key } '][SetWithDefaults](localValue);`
248+ : `this['${ key } '] = localValue;`
249+ }
228250 }` ) . join ( '\n' )
229251 }
230252 }
@@ -276,20 +298,6 @@ registry.object = class extends ProxyProperty {
276298 return ( blueprint . Proxy ?? ( ( C ) => C ) ) (
277299 codegen ( `
278300 return class MappedProxy extends Proxy {
279- ${
280- views . dirty
281- ? `
282- constructor(dataIndex, dirtyIndex) {
283- super(dataIndex, dirtyIndex);
284- let bit = this[DirtyOffset];
285- for (let i = 0; i < property.dirtyWidth; ++i) {
286- views.dirty[bit >> 3] |= 1 << (bit & 7);
287- bit += 1;
288- }
289- }
290- `
291- : ''
292- }
293301 ${ ( ( ) => {
294302 let dataIndex = 0 ;
295303 let dirtyIndex = 0 ;
0 commit comments