mobx 6.0.3 → 6.0.4

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.
@@ -4678,8 +4678,15 @@ function asObservableObject(target, name, defaultEnhancer) {
4678
4678
 
4679
4679
  if (hasProp(target, $mobx)) return target[$mobx];
4680
4680
  if ( !Object.isExtensible(target)) die("Cannot make the designated object observable; it is not extensible");
4681
- if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4682
- if (!name) name = "ObservableObject@" + getNextId();
4681
+
4682
+ if (!name) {
4683
+ if (isPlainObject(target)) {
4684
+ name = "ObservableObject@" + getNextId();
4685
+ } else {
4686
+ name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4687
+ }
4688
+ }
4689
+
4683
4690
  var adm = new ObservableObjectAdministration(target, new Map(), stringifyKey(name), defaultEnhancer);
4684
4691
  addHiddenProp(target, $mobx, adm);
4685
4692
  return adm;