How to detect if a property is a Ember.ComputedProperty BEFORE creating?


#1

Is there a reliable way to detect if a property is instanceof Ember.ComputedProperty?

At this time writing, I’m detecting it like this:

var minion = Ember.Object.extend({
  banana: 1,

  isHappy: Ember.computed.gt('banana', 0) 
});

var isComputedProperty = minion.__ember_meta__.descs.isHappy instanceof Ember.ComputedProperty;

But, relying on __ember_meta__ I don’t have a good feeling…


#2

Now, that the EmberObject.__ember_meta__.descs is gone, what’s the safest way to find out if a property is declared as a ComputedProperty before it get’s created/initialized?

If the object is already created, it’s a no-brainer, but how would I find out about a defined ComputedProperty beforehand? Any hints?