mobx 6.13.6 → 6.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4684,8 +4684,8 @@
4684
4684
  if (!change) {
4685
4685
  return this;
4686
4686
  }
4687
- // ideally, value = change.value would be done here, so that values can be
4688
- // changed by interceptor. Same applies for other Set and Map api's.
4687
+ // implemented reassignment same as it's done for ObservableMap
4688
+ value = change.newValue;
4689
4689
  }
4690
4690
  if (!this.has(value)) {
4691
4691
  transaction(function () {
@@ -5740,6 +5740,8 @@
5740
5740
  return eq(a, b, depth);
5741
5741
  }
5742
5742
  // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
5743
+ // Modified: "Deep compare objects" part to iterate over keys in forward order instead of reverse order.
5744
+ //
5743
5745
  // Internal recursive comparison function for `isEqual`.
5744
5746
  function eq(a, b, depth, aStack, bStack) {
5745
5747
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -5852,15 +5854,14 @@
5852
5854
  } else {
5853
5855
  // Deep compare objects.
5854
5856
  var keys = Object.keys(a);
5855
- var key;
5856
- length = keys.length;
5857
+ var _length = keys.length;
5857
5858
  // Ensure that both objects contain the same number of properties before comparing deep equality.
5858
- if (Object.keys(b).length !== length) {
5859
+ if (Object.keys(b).length !== _length) {
5859
5860
  return false;
5860
5861
  }
5861
- while (length--) {
5862
+ for (var i = 0; i < _length; i++) {
5862
5863
  // Deep compare each member
5863
- key = keys[length];
5864
+ var key = keys[i];
5864
5865
  if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {
5865
5866
  return false;
5866
5867
  }