mam 1.11.755 → 1.11.756

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])
@@ -7993,7 +7993,7 @@ var $;
7993
7993
  ;
7994
7994
  "use strict";
7995
7995
  var $;
7996
- (function ($) {
7996
+ (function ($_1) {
7997
7997
  $mol_test({
7998
7998
  'init with overload'() {
7999
7999
  class X extends $mol_object {
@@ -8006,6 +8006,13 @@ var $;
8006
8006
  });
8007
8007
  $mol_assert_equal(x.foo(), 2);
8008
8008
  },
8009
+ 'Context in instance inherits from class'($) {
8010
+ const custom = $.$mol_ambient({});
8011
+ class X extends $.$mol_object {
8012
+ static $ = custom;
8013
+ }
8014
+ $mol_assert_equal(new X().$, custom);
8015
+ },
8009
8016
  });
8010
8017
  })($ || ($ = {}));
8011
8018