From b7c6dd0a4e27e2d22105068af3c3f7035d60d894 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Wed, 3 Apr 2019 12:37:51 -0700 Subject: [PATCH 1/2] [BUGFIX] Fixes the isComputed check for beta In beta, `computed` now returns a decorator function instead of a ComputedProperty instance (ComputedProperty is now internal only). This changes the check to be against a function, and to see if it has the `_getter` property that we still expose for the time being. --- addon/is-computed.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addon/is-computed.js b/addon/is-computed.js index 04b0ae8..54bfddd 100644 --- a/addon/is-computed.js +++ b/addon/is-computed.js @@ -1,5 +1,8 @@ import ComputedProperty from '@ember/object/computed'; export default function(key) { - return key instanceof ComputedProperty; + return ( + key instanceof ComputedProperty || + (typeof key === 'function' && '_getter' in key) + ); } From 6bf4ce7cf5f2364d5d94466b95584a4695a54015 Mon Sep 17 00:00:00 2001 From: Kelly Selden Date: Fri, 3 May 2019 11:22:38 +0100 Subject: [PATCH 2/2] fix linting --- addon/is-computed.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addon/is-computed.js b/addon/is-computed.js index 54bfddd..897ea20 100644 --- a/addon/is-computed.js +++ b/addon/is-computed.js @@ -1,8 +1,6 @@ import ComputedProperty from '@ember/object/computed'; export default function(key) { - return ( - key instanceof ComputedProperty || - (typeof key === 'function' && '_getter' in key) - ); + return key instanceof ComputedProperty || + typeof key === 'function' && '_getter' in key; }