mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 10:05:34 +08:00
perf(isObject): use strict comparison
this is a micro-optimization based on http://jsperf.com/isobject4 no significant improvement in macro-benchmarks, but since it makes the code better it makes sense making this change.
This commit is contained in:
@@ -441,7 +441,10 @@ function isDefined(value){return typeof value !== 'undefined';}
|
||||
* @param {*} value Reference to check.
|
||||
* @returns {boolean} True if `value` is an `Object` but not `null`.
|
||||
*/
|
||||
function isObject(value){return value != null && typeof value === 'object';}
|
||||
function isObject(value){
|
||||
// http://jsperf.com/isobject4
|
||||
return value !== null && typeof value === 'object';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user