mol_view_tree2_lib 1.0.36 → 1.0.37

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
@@ -199,7 +199,7 @@ var $;
199
199
  if (this[$mol_ambient_ref])
200
200
  return this[$mol_ambient_ref];
201
201
  const owner = $mol_owning_get(this);
202
- return this[$mol_ambient_ref] = owner?.$ || $mol_object2.$;
202
+ return this[$mol_ambient_ref] = owner?.$ || this.constructor.$ || $mol_object2.$;
203
203
  }
204
204
  set $(next) {
205
205
  if (this[$mol_ambient_ref])
package/node.test.js CHANGED
@@ -190,7 +190,7 @@ var $;
190
190
  if (this[$mol_ambient_ref])
191
191
  return this[$mol_ambient_ref];
192
192
  const owner = $mol_owning_get(this);
193
- return this[$mol_ambient_ref] = owner?.$ || $mol_object2.$;
193
+ return this[$mol_ambient_ref] = owner?.$ || this.constructor.$ || $mol_object2.$;
194
194
  }
195
195
  set $(next) {
196
196
  if (this[$mol_ambient_ref])
@@ -6432,7 +6432,7 @@ var $;
6432
6432
  ;
6433
6433
  "use strict";
6434
6434
  var $;
6435
- (function ($) {
6435
+ (function ($_1) {
6436
6436
  $mol_test({
6437
6437
  'init with overload'() {
6438
6438
  class X extends $mol_object {
@@ -6445,6 +6445,13 @@ var $;
6445
6445
  });
6446
6446
  $mol_assert_equal(x.foo(), 2);
6447
6447
  },
6448
+ 'Context in instance inherits from class'($) {
6449
+ const custom = $.$mol_ambient({});
6450
+ class X extends $.$mol_object {
6451
+ static $ = custom;
6452
+ }
6453
+ $mol_assert_equal(new X().$, custom);
6454
+ },
6448
6455
  });
6449
6456
  })($ || ($ = {}));
6450
6457