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.
package/dist/mobx.esm.js CHANGED
@@ -4692,8 +4692,15 @@ function asObservableObject(target, name, defaultEnhancer) {
4692
4692
 
4693
4693
  if (hasProp(target, $mobx)) return target[$mobx];
4694
4694
  if (process.env.NODE_ENV !== "production" && !Object.isExtensible(target)) die("Cannot make the designated object observable; it is not extensible");
4695
- if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4696
- if (!name) name = "ObservableObject@" + getNextId();
4695
+
4696
+ if (!name) {
4697
+ if (isPlainObject(target)) {
4698
+ name = "ObservableObject@" + getNextId();
4699
+ } else {
4700
+ name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4701
+ }
4702
+ }
4703
+
4697
4704
  var adm = new ObservableObjectAdministration(target, new Map(), stringifyKey(name), defaultEnhancer);
4698
4705
  addHiddenProp(target, $mobx, adm);
4699
4706
  return adm;