|
436 | 436 | || target[property] === undefined) { |
437 | 437 |
|
438 | 438 | var oldValue = target[property], |
439 | | - newValue = newValue && newValue._isDataContext ? newValue : createDataContext(newValue, property); |
| 439 | + newValue = newValue && newValue._isDataContext ? newValue : createDataContext(newValue); |
440 | 440 |
|
441 | 441 |
|
442 | 442 | if (oldValue !== newValue) { |
|
448 | 448 | var isDC = newValue?._isDataContext; |
449 | 449 | var isNew = oldValue === undefined; |
450 | 450 |
|
451 | | - if (isDC) { |
452 | | - newValue._isModified = true; |
453 | | - newValue._parent = proxy; |
454 | | - newValue._propertyName = property; |
455 | | - } |
456 | | - |
457 | 451 | if (isNew) { |
458 | 452 | //console.log("'-new' set: oldValue is undefined", property, event); |
459 | 453 | eventName = "new"; |
460 | 454 | } |
461 | | - else if (isDC && typeof newValue._propertyName === 'string' && newValue._propertyName !== property) { |
| 455 | + else if (isDC && newValue._propertyName !== null && newValue._propertyName !== property) { |
462 | 456 | //console.log("'-reposition' set: newValue propertyName is change ", newValue + "", ">", property, event); |
463 | 457 | eventName = "reposition"; |
464 | 458 | } |
|
470 | 464 | target.emitToParent("-", { eventName, target, propertyPath: [property], oldValue, newValue }); |
471 | 465 | target.emit(property, { eventName, target, propertyPath: [property], oldValue, newValue }); |
472 | 466 |
|
| 467 | + if (isDC) { |
| 468 | + newValue._isModified = true; |
| 469 | + newValue._parent = proxy; |
| 470 | + newValue._propertyName = property; |
| 471 | + } |
| 472 | + |
473 | 473 | setModified(target, property); |
474 | 474 |
|
475 | 475 | target.emitToParent("-change", { eventName: "-change", target }); |
|
0 commit comments