diff --git a/misc/states.js b/misc/states.js index 6d98da8..657c7ed 100644 --- a/misc/states.js +++ b/misc/states.js @@ -131,6 +131,15 @@ states.Dependent.prototype = { */ compare: function (reference, selector, state) { var value = this.values[selector][state.name]; + + // Internet explorer don't support the name property on the constructor but + // in some cases we can compare the contructor to an object type. + if (typeof reference.constructor.name === 'undefined') { + if (reference.constructor === Number) { + reference.constructor.name = 'Number'; + } + } + if (reference.constructor.name in states.Dependent.comparisons) { // Use a custom compare function for certain reference value types. return states.Dependent.comparisons[reference.constructor.name](reference, value);