@colyseus/schema 4.0.11 → 4.0.12

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/build/index.cjs CHANGED
@@ -4054,7 +4054,11 @@ class Root {
4054
4054
  const ref = changeTree.ref;
4055
4055
  // Assign unique `refId` to ref if it doesn't have one yet.
4056
4056
  if (ref[$refId] === undefined) {
4057
- ref[$refId] = this.getNextUniqueId();
4057
+ Object.defineProperty(ref, $refId, {
4058
+ value: this.getNextUniqueId(),
4059
+ enumerable: false,
4060
+ writable: true
4061
+ });
4058
4062
  }
4059
4063
  const refId = ref[$refId];
4060
4064
  const isNewChangeTree = (this.changeTrees[refId] === undefined);
@@ -4496,7 +4500,11 @@ class ReferenceTracker {
4496
4500
  // for decoding
4497
4501
  addRef(refId, ref, incrementCount = true) {
4498
4502
  this.refs.set(refId, ref);
4499
- ref[$refId] = refId;
4503
+ Object.defineProperty(ref, $refId, {
4504
+ value: refId,
4505
+ enumerable: false,
4506
+ writable: true
4507
+ });
4500
4508
  if (incrementCount) {
4501
4509
  this.refCount[refId] = (this.refCount[refId] || 0) + 1;
4502
4510
  }