diff options
Diffstat (limited to 'install/ui/src/freeipa/_base')
-rw-r--r-- | install/ui/src/freeipa/_base/Builder.js | 1 | ||||
-rw-r--r-- | install/ui/src/freeipa/_base/construct.js | 20 |
2 files changed, 19 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/_base/Builder.js b/install/ui/src/freeipa/_base/Builder.js index 0eb76c4a7..d01f86f17 100644 --- a/install/ui/src/freeipa/_base/Builder.js +++ b/install/ui/src/freeipa/_base/Builder.js @@ -84,6 +84,7 @@ define(['dojo/_base/declare', var f,c; if (spec === undefined || spec === null) return null; + if (!construct.is_spec(spec)) return spec; context = context || {}; diff --git a/install/ui/src/freeipa/_base/construct.js b/install/ui/src/freeipa/_base/construct.js index bc017ad66..e44c66b1e 100644 --- a/install/ui/src/freeipa/_base/construct.js +++ b/install/ui/src/freeipa/_base/construct.js @@ -34,12 +34,28 @@ define(['dojo/_base/declare', */ is_ctor: function(obj) { - // TODO: Find better method. Check by extend might not be very - // reliable. return typeof obj === 'function' && typeof obj.extend === 'function'; }, /** + * Finds out if object is a spec object. + * + * Object is not a spec object when any of following applies: + * * has __fw_obj === true + * * has isInstanceOf function - basically tells if it's a instance of + * dojo-based class + * + */ + is_spec: function(obj) { + var ret = false; + if (typeof obj === 'object') { + ret = obj.__fw_obj === true || + typeof obj.isInstanceOf === 'function'; + } + return !ret; + }, + + /** * Creates copy of construction specification * * It makes sure that pre_ops, post_ops and spec are new Arrays/Object |