You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
similar to && and ||, I think and() and or() should be lazy. For example, the following should pass:
QUnit.test("and is lazy",function(){varview=stache("<div>{{#and(this.isFalse, this.shouldNotBeRead)}}TRUE{{else}}FALSE{{/and}}</div>");varfragment=view({isFalse: false,shouldNotBeRead: newObservation(functionavoidReadingThis(){QUnit.ok(false,"should not be read");})});QUnit.equal(fragment.firstChild.innerHTML,"FALSE","evaled to false");});
Currently this doesn't because Lookup() always Observation.temporarilyBind(data) so initialData can be peaked at ....
Lookup::value also warns about missing values. This would somehow have to be done later. Perhaps via some ScopeKeyData configuration ...
I think we'd want ScopeKeyData.initialValue to "temporary bind" if it's not already bound. This way, things that were already reading initialValue would still work.
The text was updated successfully, but these errors were encountered:
similar to
&&
and||
, I thinkand()
andor()
should be lazy. For example, the following should pass:Currently this doesn't because
Lookup()
alwaysObservation.temporarilyBind(data)
so initialData can be peaked at ....Lookup::value
also warns about missing values. This would somehow have to be done later. Perhaps via some ScopeKeyData configuration ...I think we'd want ScopeKeyData.initialValue to "temporary bind" if it's not already bound. This way, things that were already reading
initialValue
would still work.The text was updated successfully, but these errors were encountered: