mobx 6.3.12 → 6.3.13

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.
@@ -731,7 +731,7 @@ function make_$2(adm, key, descriptor, source) {
731
731
  // bound - must annotate protos to support super.flow()
732
732
 
733
733
 
734
- if ((_this$options_ = this.options_) != null && _this$options_.bound && !isFlow(adm.target_[key])) {
734
+ if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {
735
735
  if (this.extend_(adm, key, descriptor, false) === null) return 0
736
736
  /* Cancel */
737
737
  ;
@@ -775,16 +775,23 @@ safeDescriptors) {
775
775
  }
776
776
 
777
777
  assertFlowDescriptor(adm, annotation, key, descriptor);
778
- var value = descriptor.value;
778
+ var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype
779
+
780
+ if (!isFlow(value)) {
781
+ value = flow(value);
782
+ }
779
783
 
780
784
  if (bound) {
781
785
  var _adm$proxy_;
782
786
 
783
- value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);
787
+ // We do not keep original function around, so we bind the existing flow
788
+ value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...
789
+
790
+ value.isMobXFlow = true;
784
791
  }
785
792
 
786
793
  return {
787
- value: flow(value),
794
+ value: value,
788
795
  // Non-configurable for classes
789
796
  // prevents accidental field redefinition in subclass
790
797
  configurable: safeDescriptors ? adm.isPlainObject_ : true,