源代码部分是
getAllKeys(spec).forEach(function(key) {
if (hasOwnProperty.call(commands, key)) {
var objectWasNextObject = object === nextObject;
nextObject = commands[key](spec[key], nextObject, spec, object);
if (objectWasNextObject && update.isEquals(nextObject, object)) {
nextObject = object;
}
} else {
...
}
})
并且update.isEquals代码是
update.isEquals = function(a, b) { return a === b; };
为什么需要nextObject = object;
当isEquals
为true
时,nextObject
euqal object
已经