* ※ This function can be used to check if the provided value has
* private tag features.
*
+ * ※ `Tag::system` is an overridable, publicly‐accessible means of
+ * accessing the system.
+ *
* ※ This function is not exposed.
*/
static getSystem($) {
return this.#kind;
}
+ /**
+ * Returns the `TagSystem` for this `Tag`.
+ *
+ * ※ Internally, `Tag.getSystem` is preferred.
+ */
+ get system() {
+ return this.#system;
+ }
+
/**
* Persist this `Tag` to storage and return an ActivityStreams
* serialization of a Tag Activity representing any changes, or
function Tag() {
throw new TypeError("Tags must belong to a System.");
};
- const { prototype: methods } = this;
- delete methods.constructor;
+ const { prototype: staticFeatures } = this;
+ delete staticFeatures.constructor;
Object.defineProperty(superclass, "prototype", {
configurable: false,
enumerable: false,
});
Object.defineProperties(
superclass,
- Object.getOwnPropertyDescriptors(methods),
+ Object.getOwnPropertyDescriptors(staticFeatures),
);
}
}
}
+ /** Returns the `TagSystem` for this `Tag` constructor. */
+ get system() {
+ return this.#system;
+ }
+
/**
* Returns a new `Tag` constructed from the provided data and
* with the provided identifier.
});
});
+ describe(".system", () => {
+ it("[[Call]] returns the `TagSystem`", () => {
+ assertEquals(Tag.system, system);
+ });
+ });
+
// `.[Storage.toInstance]` is tested by `.fromIdentifier`.
describe("::addAltLabel", () => {
});
});
+ describe("::system", () => {
+ it("[[Get]] returns the tag system", () => {
+ assertStrictEquals(new Tag().system, system);
+ });
+ });
+
// `::tagURI` is tested by a `.fromTagURI`.
describe("::taggingEntity", () => {