Skip to content

Commit 23467c5

Browse files
committed
v2.0
1 parent fa90530 commit 23467c5

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
|| target[property] === undefined) {
437437

438438
var oldValue = target[property],
439-
newValue = newValue && newValue._isDataContext ? newValue : createDataContext(newValue, property);
439+
newValue = newValue && newValue._isDataContext ? newValue : createDataContext(newValue);
440440

441441

442442
if (oldValue !== newValue) {
@@ -448,17 +448,11 @@
448448
var isDC = newValue?._isDataContext;
449449
var isNew = oldValue === undefined;
450450

451-
if (isDC) {
452-
newValue._isModified = true;
453-
newValue._parent = proxy;
454-
newValue._propertyName = property;
455-
}
456-
457451
if (isNew) {
458452
//console.log("'-new' set: oldValue is undefined", property, event);
459453
eventName = "new";
460454
}
461-
else if (isDC && typeof newValue._propertyName === 'string' && newValue._propertyName !== property) {
455+
else if (isDC && newValue._propertyName !== null && newValue._propertyName !== property) {
462456
//console.log("'-reposition' set: newValue propertyName is change ", newValue + "", ">", property, event);
463457
eventName = "reposition";
464458
}
@@ -470,6 +464,12 @@
470464
target.emitToParent("-", { eventName, target, propertyPath: [property], oldValue, newValue });
471465
target.emit(property, { eventName, target, propertyPath: [property], oldValue, newValue });
472466

467+
if (isDC) {
468+
newValue._isModified = true;
469+
newValue._parent = proxy;
470+
newValue._propertyName = property;
471+
}
472+
473473
setModified(target, property);
474474

475475
target.emitToParent("-change", { eventName: "-change", target });

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "data-context",
33
"description": "Watch data changes in the browser and node.js",
4-
"version": "2.0.0-beta.23",
4+
"version": "2.0.0-beta.24",
55
"license": "MIT",
66
"keywords": [
77
"on",

0 commit comments

Comments
 (0)