lundi 18 janvier 2016

ES6 class getters broken in ember 2.3?

I'm having some weird behavior after upgrading from ember 2.2 to 2.3. I've narrowed it down to the getters in an ES6 class.

If I have a class like this, calling foo.prop will return undefined.

class Foo {
  get prop() {
    return 10;
  }
}

Everything works if I change the class like so:

class Foo {
  constructor() {
    this.prop = 10;
  }
}

I'm using foo.prop in some computed properties and/or templates.

What is going on here?




Aucun commentaire:

Enregistrer un commentaire