cfprotected 1.3.1 → 1.3.2

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.
Files changed (2) hide show
  1. package/index.mjs +2 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -190,8 +190,8 @@ function share(inst, klass, members) {
190
190
  */
191
191
  function saveSelf(self, name) {
192
192
  Object.defineProperty(self, name, {value: self});
193
- if (typeof(self) == "function") {
194
- Object.defineProperty(self.prototype, "cla$$", {value: self});
193
+ if ((typeof(self) == "function") && (typeof(self.prototype) == "object") && !Object.hasOwn(self.prototype, "cla$$")) {
194
+ Object.defineProperty(self.prototype, "cla$$", {value: self, configurable: true});
195
195
  }
196
196
  }
197
197
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfprotected",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "An implementation of protected fields on top of class fields.",
5
5
  "main": "index.js",
6
6
  "scripts": {