mol_wire_lib 1.0.1582 → 1.0.1584

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.mjs CHANGED
@@ -647,7 +647,7 @@ var $;
647
647
  if (this[$mol_ambient_ref])
648
648
  return this[$mol_ambient_ref];
649
649
  const owner = $mol_owning_get(this);
650
- return this[$mol_ambient_ref] = owner?.$ || $mol_object2.$;
650
+ return this[$mol_ambient_ref] = owner?.$ || this.constructor.$ || $mol_object2.$;
651
651
  }
652
652
  set $(next) {
653
653
  if (this[$mol_ambient_ref])
package/node.test.js CHANGED
@@ -638,7 +638,7 @@ var $;
638
638
  if (this[$mol_ambient_ref])
639
639
  return this[$mol_ambient_ref];
640
640
  const owner = $mol_owning_get(this);
641
- return this[$mol_ambient_ref] = owner?.$ || $mol_object2.$;
641
+ return this[$mol_ambient_ref] = owner?.$ || this.constructor.$ || $mol_object2.$;
642
642
  }
643
643
  set $(next) {
644
644
  if (this[$mol_ambient_ref])
@@ -3042,7 +3042,7 @@ var $;
3042
3042
  ;
3043
3043
  "use strict";
3044
3044
  var $;
3045
- (function ($) {
3045
+ (function ($_1) {
3046
3046
  $mol_test({
3047
3047
  'init with overload'() {
3048
3048
  class X extends $mol_object {
@@ -3055,6 +3055,13 @@ var $;
3055
3055
  });
3056
3056
  $mol_assert_equal(x.foo(), 2);
3057
3057
  },
3058
+ 'Context in instance inherits from class'($) {
3059
+ const custom = $.$mol_ambient({});
3060
+ class X extends $.$mol_object {
3061
+ static $ = custom;
3062
+ }
3063
+ $mol_assert_equal(new X().$, custom);
3064
+ },
3058
3065
  });
3059
3066
  })($ || ($ = {}));
3060
3067