mol_dump_lib 0.0.494 → 0.0.495

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/web.js CHANGED
@@ -4525,10 +4525,19 @@ var $;
4525
4525
  "use strict";
4526
4526
  var $;
4527
4527
  (function ($) {
4528
+ const factories = new WeakMap();
4529
+ function factory(val) {
4530
+ let make = factories.get(val);
4531
+ if (make)
4532
+ return make;
4533
+ make = $mol_func_name_from((...args) => new val(...args), val);
4534
+ factories.set(val, make);
4535
+ return make;
4536
+ }
4528
4537
  function $mol_wire_sync(obj) {
4529
4538
  return new Proxy(obj, {
4530
4539
  get(obj, field) {
4531
- const val = obj[field];
4540
+ let val = obj[field];
4532
4541
  if (typeof val !== 'function')
4533
4542
  return val;
4534
4543
  const temp = $mol_wire_task.getter(val);
@@ -4537,10 +4546,13 @@ var $;
4537
4546
  return fiber.sync();
4538
4547
  };
4539
4548
  },
4549
+ construct(obj, args) {
4550
+ const temp = $mol_wire_task.getter(factory(obj));
4551
+ return temp(obj, args).sync();
4552
+ },
4540
4553
  apply(obj, self, args) {
4541
4554
  const temp = $mol_wire_task.getter(obj);
4542
- const fiber = temp(self, args);
4543
- return fiber.sync();
4555
+ return temp(self, args).sync();
4544
4556
  },
4545
4557
  });
4546
4558
  }