mol_wire_lib 1.0.381 → 1.0.383

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/node.js CHANGED
@@ -935,6 +935,34 @@ var $;
935
935
  ;
936
936
  "use strict";
937
937
  var $;
938
+ (function ($) {
939
+ function $mol_func_name(func) {
940
+ let name = func.name;
941
+ if (name?.length > 1)
942
+ return name;
943
+ for (let key in this) {
944
+ try {
945
+ if (this[key] !== func)
946
+ continue;
947
+ name = key;
948
+ Object.defineProperty(func, 'name', { value: name });
949
+ break;
950
+ }
951
+ catch { }
952
+ }
953
+ return name;
954
+ }
955
+ $.$mol_func_name = $mol_func_name;
956
+ function $mol_func_name_from(target, source) {
957
+ Object.defineProperty(target, 'name', { value: source.name });
958
+ return target;
959
+ }
960
+ $.$mol_func_name_from = $mol_func_name_from;
961
+ })($ || ($ = {}));
962
+ //mol/func/name/name.ts
963
+ ;
964
+ "use strict";
965
+ var $;
938
966
  (function ($) {
939
967
  function $mol_guid(length = 8, exists = () => false) {
940
968
  for (;;) {
@@ -1020,7 +1048,8 @@ var $;
1020
1048
  const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1021
1049
  if (existen)
1022
1050
  return existen;
1023
- const key = `${host?.[Symbol.toStringTag] ?? host}.${field}`;
1051
+ const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1052
+ const key = `${prefix}.${field}`;
1024
1053
  const fiber = new $mol_wire_atom(key, task, host, []);
1025
1054
  (host ?? task)[field] = fiber;
1026
1055
  return fiber;
@@ -1028,7 +1057,8 @@ var $;
1028
1057
  static plex(host, task, key) {
1029
1058
  const field = task.name + '()';
1030
1059
  let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1031
- const id = `${host?.[Symbol.toStringTag] ?? host}.${task.name}(${$mol_key(key)})`;
1060
+ const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1061
+ const id = `${prefix}.${task.name}(${$mol_key(key)})`;
1032
1062
  if (dict) {
1033
1063
  const existen = dict.get(id);
1034
1064
  if (existen)