From 19e47a2742b8225cbce8ead7f638f1e0360e7d9a Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 29 Jan 2014 18:09:15 +0100 Subject: [PATCH] Local SRs. --- src/helpers.coffee | 5 +++++ src/spec.coffee | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/helpers.coffee b/src/helpers.coffee index c2546f5c3..bea19a129 100644 --- a/src/helpers.coffee +++ b/src/helpers.coffee @@ -112,7 +112,10 @@ $watch = (collection, { # avoid an infinite loop. loops = 0 + updating = false + process = (event, items) -> + return if updating # Values are grouped by namespace. valuesByNamespace = Object.create null @@ -162,10 +165,12 @@ $watch = (collection, { # changed. unless changed is false values[namespace] = ctx.value + updating = true if namespace is 'common' collection.touch consumers else collection.touch (namespace.substr 1) + updating = false loops = previousLoops diff --git a/src/spec.coffee b/src/spec.coffee index 1f7bcd781..c2b02d90d 100644 --- a/src/spec.coffee +++ b/src/spec.coffee @@ -502,6 +502,14 @@ module.exports = -> } @rule SR: -> + @data = { + # Note: not dynamic. + host: $link( + -> @genval.PBDs[0] ? 'OpaqueRef:NULL' + -> @val.host + ) + } + @val = { name_label: -> @genval.name_label @@ -521,7 +529,7 @@ module.exports = -> if @genval.shared @genval.$poolRef else - null # TODO + @data.host $PBDs: -> @genval.PBDs