Skip to content

{ parse: true } not passed to children #106

Open
@jackboberg

Description

I am not sure if this is expected behavior.

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 });

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions