#mildlycursedcode — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #mildlycursedcode, aggregated by home.social.
-
It's good to see my favourite WPF feature isn't dead:
class StamperBase { constructor(o) { return o; } } class MyAttachedProperty extends StamperBase { #name; static getName(o) { return o.#name; } static setName(o, v) { return o.#name = v; } } const hostInit = Host.prototype.initialize; Host.prototype.initialize = function() { new MyAttachedProperty(this); return hostInit.apply(this, arguments); }; export const attachedNames = { get: MyAttachedProperty.get, set: MyAttachedProperty.set, };
#JavaScript #encapsulation #pluginDev #shitpost #mildlyCursedCode