mam 1.11.754 → 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
 
@@ -8056,7 +8063,7 @@ var $;
8056
8063
  }
8057
8064
  await $mol_wire_async(A).a();
8058
8065
  $mol_assert_equal(A.instances.length, 2);
8059
- $mol_assert_equal(A.instances[0] instanceof A);
8066
+ $mol_assert_equal(A.instances[0] instanceof A, true);
8060
8067
  $mol_assert_equal(A.instances[0], A.instances[1]);
8061
8068
  }
8062
8069
  });
@@ -8932,16 +8939,16 @@ var $;
8932
8939
  $mol_assert_unique([1], [2], [3]);
8933
8940
  },
8934
8941
  'two must be alike'() {
8935
- $mol_assert_like([3], [3]);
8942
+ $mol_assert_equal([3], [3]);
8936
8943
  },
8937
8944
  'three must be alike'() {
8938
- $mol_assert_like([3], [3], [3]);
8945
+ $mol_assert_equal([3], [3], [3]);
8939
8946
  },
8940
8947
  'two object must be alike'() {
8941
- $mol_assert_like({ a: 1 }, { a: 1 });
8948
+ $mol_assert_equal({ a: 1 }, { a: 1 });
8942
8949
  },
8943
8950
  'three object must be alike'() {
8944
- $mol_assert_like({ a: 1 }, { a: 1 }, { a: 1 });
8951
+ $mol_assert_equal({ a: 1 }, { a: 1 }, { a: 1 });
8945
8952
  },
8946
8953
  });
8947
8954
  })($ || ($ = {}));