can-stache-bindings
Advanced tools
Comparing version 4.10.6 to 4.10.7
@@ -1111,7 +1111,8 @@ "use strict"; | ||
}; | ||
bindingOptions.updateChildName = tagStart+" "+nodeHTML+"> updates "+ | ||
bindingOptions.debugName = tagStart+" "+nodeHTML+">"; | ||
bindingOptions.updateChildName = bindingOptions.debugName+" updates "+ | ||
makeUpdateName(siblingBindingData.child.source, siblingBindingData.child.name)+ | ||
" from "+makeUpdateName(siblingBindingData.parent.source, siblingBindingData.parent.name); | ||
bindingOptions.updateParentName = tagStart+" "+nodeHTML+"> updates "+ | ||
bindingOptions.updateParentName = bindingOptions.debugName+" updates "+ | ||
makeUpdateName(siblingBindingData.parent.source, siblingBindingData.parent.name)+ | ||
@@ -1118,0 +1119,0 @@ " from "+makeUpdateName(siblingBindingData.child.source, siblingBindingData.child.name); |
{ | ||
"name": "can-stache-bindings", | ||
"version": "4.10.6", | ||
"version": "4.10.7", | ||
"description": "Default binding syntaxes for can-stache", | ||
@@ -36,3 +36,3 @@ "homepage": "https://canjs.com/doc/can-stache-bindings.html", | ||
"can-attribute-observable": "^1.2.5", | ||
"can-bind": "^1.4.0", | ||
"can-bind": "^1.4.2", | ||
"can-dom-data": "^1.0.1", | ||
@@ -61,3 +61,3 @@ "can-dom-events": "^1.3.3", | ||
"can-globals": "^1.0.0", | ||
"can-test-helpers": "^1.1.1", | ||
"can-test-helpers": "^1.1.4", | ||
"can-vdom": "^4.0.0", | ||
@@ -64,0 +64,0 @@ "can-view-nodelist": "^4.0.0", |
@@ -290,3 +290,3 @@ var QUnit = require('steal-qunit'); | ||
attr: function(prop, val){ | ||
if(prop === "bar") { | ||
if(arguments.length > 1 && prop === "bar") { | ||
assert.equal(val, "BAR"); | ||
@@ -864,2 +864,33 @@ } | ||
}); | ||
canTestHelpers.dev.devOnlyTest("warn when changing the value of a sticky binding child-side (initializing view model)", function(assert) { | ||
assert.expect(2); | ||
var teardown = canTestHelpers.dev.willWarn( | ||
"can-bind: The child of the sticky two-way binding <my-child name.first:bind=\"name\"> is changing or converting its value when set. " + | ||
"Conversions should only be done on the binding parent to preserve synchronization. " + | ||
"See https://canjs.com/doc/can-stache-bindings.html#StickyBindings for more about sticky bindings", | ||
function(text, match) { | ||
if(match) { | ||
assert.ok(true, "Correct warning generated"); | ||
} | ||
} | ||
); | ||
var childVM = new SimpleMap({ | ||
name: { | ||
first: "Matt" | ||
} | ||
}); | ||
MockComponent.extend({ | ||
tag: "my-child", | ||
viewModel: childVM, | ||
template: stache('<input value:bind="name.first" />') | ||
}); | ||
var parentVM = new SimpleMap({ | ||
name: 'Justin' | ||
}); | ||
stache('<my-child name.first:bind="name" /><input value:bind="name" />')(parentVM); | ||
assert.equal(teardown(), 1, "Warning generated only once"); | ||
}); | ||
}); |
217554
4242
Updatedcan-bind@^1.4.2