From 0cd65f8c04efbd74f6755947dcd2aee7dd97935a Mon Sep 17 00:00:00 2001 From: Justin Meyer Date: Tue, 19 Jun 2018 15:53:30 -0500 Subject: [PATCH] for #110, only assign getChagnesDepsRecord in dev --- lib/attr.js | 2 +- lib/attrs.js | 5 +++-- lib/html.js | 6 ++++-- lib/text.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/attr.js b/lib/attr.js index cab930c..bc2b3c2 100644 --- a/lib/attr.js +++ b/lib/attr.js @@ -32,6 +32,7 @@ live.attr = function(el, attributeName, compute) { function liveUpdateAttr(newVal) { queues.domUIQueue.enqueue(attr.set, attr, [el, attributeName, newVal]); } + //!steal-remove-start // register that the handler changes the parent element canReflect.assignSymbols(liveUpdateAttr, { "can.getChangesDependencyRecord": function() { @@ -40,7 +41,6 @@ live.attr = function(el, attributeName, compute) { }; } }); - //!steal-remove-start Object.defineProperty(liveUpdateAttr, "name", { value: "live.attr update::"+canReflect.getName(compute), }); diff --git a/lib/attrs.js b/lib/attrs.js index 669642c..748dfde 100644 --- a/lib/attrs.js +++ b/lib/attrs.js @@ -58,6 +58,8 @@ live.attrs = function(el, compute, scope, options) { } oldAttrs = newAttrs; } + + //!steal-remove-start // register that the handler changes the parent element canReflect.assignSymbols(liveAttrsUpdate, { "can.getChangesDependencyRecord": function() { @@ -66,8 +68,7 @@ live.attrs = function(el, compute, scope, options) { }; } }); - - //!steal-remove-start + Object.defineProperty(liveAttrsUpdate, "name", { value: "live.attrs update::"+canReflect.getName(compute), }); diff --git a/lib/html.js b/lib/html.js index e802c6f..640088d 100644 --- a/lib/html.js +++ b/lib/html.js @@ -66,6 +66,9 @@ live.html = function(el, compute, parentNode, nodeList) { var pn = nodeLists.first(nodes).parentNode; data.teardownCheck(pn); } + + + //!steal-remove-start // register that the handler changes the parent element canReflect.assignSymbols(liveHTMLUpdateHTML, { "can.getChangesDependencyRecord": function() { @@ -74,8 +77,7 @@ live.html = function(el, compute, parentNode, nodeList) { }; } }); - - //!steal-remove-start + Object.defineProperty(liveHTMLUpdateHTML, "name", { value: "live.html update::"+canReflect.getName(compute), }); diff --git a/lib/text.js b/lib/text.js index 1127f1d..c7be32b 100644 --- a/lib/text.js +++ b/lib/text.js @@ -37,6 +37,7 @@ live.text = function(el, compute, parentNode, nodeList) { el.nodeValue = live.makeString(newVal); } + //!steal-remove-start // register that the handler changes the parent element canReflect.assignSymbols(liveTextUpdateTextNode, { "can.getChangesDependencyRecord": function() { @@ -46,7 +47,6 @@ live.text = function(el, compute, parentNode, nodeList) { } }); - //!steal-remove-start Object.defineProperty(liveTextUpdateTextNode, "name", { value: "live.text update::"+canReflect.getName(compute), });