Correct number matching in equals_

This commit is contained in:
ragaskar
2010-03-18 20:32:40 -07:00
parent c85079e9d0
commit bf938ffc50
4 changed files with 60 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ jasmine.getEnv = function() {
* @returns {Boolean}
*/
jasmine.isArray_ = function(value) {
return Object.prototype.toString.apply(value) === '[object Array]';
return jasmine.isA_("Array", value);
};
/**
@@ -99,7 +99,28 @@ jasmine.isArray_ = function(value) {
* @returns {Boolean}
*/
jasmine.isString_ = function(value) {
return Object.prototype.toString.apply(value) === '[object String]';
return jasmine.isA_("String", value);
};
/**
* @ignore
* @private
* @param value
* @returns {Boolean}
*/
jasmine.isNumber_ = function(value) {
return jasmine.isA_("Number", value);
};
/**
* @ignore
* @private
* @param {String} typeName
* @param value
* @returns {Boolean}
*/
jasmine.isA_ = function(typeName, value) {
return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
};
/**