Last active
August 29, 2015 14:09
-
-
Save jackboberg/382197e26bf435de797e to your computer and use it in GitHub Desktop.
{ parse: true } not passed to children
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var State = require('ampersand-state'); | |
var A = State.extend({ | |
props: { n: 'number' }, | |
parse: function (attrs) { | |
attrs.n = parseInt(attrs.n, 10); | |
return attrs; | |
} | |
}); | |
var B = State.extend({ | |
children: { a: A } | |
}); | |
// parses string to int | |
var a = new A({ n: '1' }, { parse: true }); | |
// throws TypeError | |
var b = new B({ a: { n: '1' } }, { parse: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment