From a1869059413081658ffce889bf08a912e410544d Mon Sep 17 00:00:00 2001 From: betocantu93 Date: Thu, 15 Apr 2021 20:24:27 -0500 Subject: [PATCH] fix tests --- addon/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addon/index.js b/addon/index.js index 7f0466cb..f5fd8073 100644 --- a/addon/index.js +++ b/addon/index.js @@ -36,18 +36,19 @@ function tryContent(ctx) { return ctx._content ? ctx._content : ctx.content ? ctx.content : ctx; } -function deepNotifyPropertyChange(obj, path) { +function deepNotifyPropertyChange(changeset, path) { let paths = path.split('.'); let maybeDynamicPathToNotify = null, lastPath = paths.pop(), - current = obj, + current = changeset, i; - let exists = safeGet(obj._content, path) !== undefined; + //If the path doesn't exists previously exist inside the CONTENT, this is a dynamic set. + let existsInContent = safeGet(changeset[CONTENT], path) !== undefined; for (i = 0; i < paths.length; ++i) { const curr = current[paths[i]]; - if (exists && curr.content === curr.content) { + if (existsInContent && curr && curr.content === curr.content) { current = current[paths[i]]; } else { maybeDynamicPathToNotify = paths[i];