mobx 6.3.1 → 6.3.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # mobx
2
2
 
3
+ ## 6.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4011b378`](https://github.com/mobxjs/mobx/commit/4011b3789d57e3dab0b85a835fe2979033133ce9) [#2949](https://github.com/mobxjs/mobx/pull/2949) Thanks [@urugator](https://github.com/urugator)! - fix #2948: flow ignores `autoBind` option
8
+
3
9
  ## 6.3.1
4
10
 
5
11
  ### Patch Changes
@@ -868,7 +868,7 @@ function createAutoAnnotation(options) {
868
868
  }
869
869
 
870
870
  function make_$5(adm, key, descriptor, source) {
871
- var _this$options_2, _this$options_3;
871
+ var _this$options_3, _this$options_4;
872
872
 
873
873
  // getter -> computed
874
874
  if (descriptor.get) {
@@ -903,22 +903,25 @@ function make_$5(adm, key, descriptor, source) {
903
903
 
904
904
 
905
905
  if (source !== adm.target_ && typeof descriptor.value === "function") {
906
- var _this$options_;
906
+ var _this$options_2;
907
907
 
908
908
  if (isGenerator(descriptor.value)) {
909
- return flow.make_(adm, key, descriptor, source);
909
+ var _this$options_;
910
+
911
+ var flowAnnotation = ((_this$options_ = this.options_) == null ? void 0 : _this$options_.autoBind) ? flow.bound : flow;
912
+ return flowAnnotation.make_(adm, key, descriptor, source);
910
913
  }
911
914
 
912
- var actionAnnotation = ((_this$options_ = this.options_) == null ? void 0 : _this$options_.autoBind) ? autoAction.bound : autoAction;
915
+ var actionAnnotation = ((_this$options_2 = this.options_) == null ? void 0 : _this$options_2.autoBind) ? autoAction.bound : autoAction;
913
916
  return actionAnnotation.make_(adm, key, descriptor, source);
914
917
  } // other -> observable
915
918
  // Copy props from proto as well, see test:
916
919
  // "decorate should work with Object.create"
917
920
 
918
921
 
919
- var observableAnnotation = ((_this$options_2 = this.options_) == null ? void 0 : _this$options_2.deep) === false ? observable.ref : observable; // if function respect autoBind option
922
+ var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option
920
923
 
921
- if (typeof descriptor.value === "function" && ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.autoBind)) {
924
+ if (typeof descriptor.value === "function" && ((_this$options_4 = this.options_) == null ? void 0 : _this$options_4.autoBind)) {
922
925
  var _adm$proxy_;
923
926
 
924
927
  descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);
@@ -928,7 +931,7 @@ function make_$5(adm, key, descriptor, source) {
928
931
  }
929
932
 
930
933
  function extend_$5(adm, key, descriptor, proxyTrap) {
931
- var _this$options_4, _this$options_5;
934
+ var _this$options_5, _this$options_6;
932
935
 
933
936
  // getter -> computed
934
937
  if (descriptor.get) {
@@ -946,13 +949,13 @@ function extend_$5(adm, key, descriptor, proxyTrap) {
946
949
  // if function respect autoBind option
947
950
 
948
951
 
949
- if (typeof descriptor.value === "function" && ((_this$options_4 = this.options_) == null ? void 0 : _this$options_4.autoBind)) {
952
+ if (typeof descriptor.value === "function" && ((_this$options_5 = this.options_) == null ? void 0 : _this$options_5.autoBind)) {
950
953
  var _adm$proxy_2;
951
954
 
952
955
  descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);
953
956
  }
954
957
 
955
- var observableAnnotation = ((_this$options_5 = this.options_) == null ? void 0 : _this$options_5.deep) === false ? observable.ref : observable;
958
+ var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;
956
959
  return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);
957
960
  }
958
961