Comparing version 0.21.17 to 0.21.18
{ | ||
"name": "alkali", | ||
"author": "Kris Zyp", | ||
"version": "0.21.17", | ||
"version": "0.21.18", | ||
"description": "Reactivity with native JavaScript objects and HTML elements", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -930,2 +930,24 @@ define(function(require) { | ||
test('inner validate', function() { | ||
var Inner = Variable.with({ | ||
text: VString, | ||
validate: o => { | ||
o = o.valueOf() | ||
var valid = [] | ||
valid.isValid = true | ||
return valid | ||
} | ||
}) | ||
var Outer = Variable.with({ | ||
inners: [Inner], | ||
}) | ||
// fails in transform below: TypeError: Cannot read property 'properties' of undefined at VString.get (Variable.js:1170) | ||
var extraction = new Outer({ inners: [{ text: 'abcd' }]}) | ||
var inner = extraction.inners.property(0) | ||
// succeeds | ||
//var inner = new Inner({ text: 'abcd' }) | ||
var isValid = inner.text.validation.to(v => v.isValid).valueOf() | ||
}) | ||
test('composite', function() { | ||
@@ -932,0 +954,0 @@ var a = new Variable(1) |
Sorry, the diff of this file is too big to display
978211
12123