From f2d64d767606fd207213a25db999ba0a47cbbf42 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Sat, 16 Sep 2017 22:16:44 -0700 Subject: [PATCH] Fix bug deleting specific object instances --- lib/session.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/session.coffee b/lib/session.coffee index 4b04d9a..dc0cc20 100644 --- a/lib/session.coffee +++ b/lib/session.coffee @@ -548,6 +548,7 @@ runDeclarations = (sessionContext, declarations) -> parent = common.addPathMeta(path.slice(0, -1)) + keys = null if Array.isArray(path[path.length - 1]) keys = {} for p, i in path[path.length - 1] by 2 @@ -1288,6 +1289,9 @@ processInstances = (sessionContext, parent, parameters, keys, minInstances, maxI else if counter <= minInstances instancesToDelete.delete(p) + # Key is null if deleting a particular instance rather than use alias + return if not keys + superset = instancesToCreate.superset(keys) for inst in superset ++ counter