@noracodes (actually, i think what is easy is shadowing data properties with other data properties, i think shadowing accessor properties is intentionally hard precisely so that things like Object.assign don’t accidentally do it)
@noracodes yeah, getters and setters are applied at a very low level in JS/TS
technically the way to understand it is that there are two kinds of properties, “data properties” and “accessor properties”. data properties have values. accessor properties do not have values, they only have accessor methods. so *anything which tries to modify that property will go through that method
(* of course, because things aren’t quite that simple, it is possible [altho hard] to overwrite an accessor property with a data property, and also possible [and somewhat easier] to shadow it further down in the prototype chain. but most JS methods do not do this)
@noracodes (if you copy and paste this code there is an invisible character after the hashes to prevent them from becoming hashtags)
@noracodes i’m wondering if this is broadly the pattern you’re looking for or if there’s more here that i am missing?
class Pokémon {
#type
constructor(data) {
Object.assign(this, data)
}
get type() { return this.#type }
set type(x) {
if (!["Normal", "Fighting", "Flying", "Poison", "Ground", "Rock", "Bug", "Ghost", "Steel", "Fire", "Grass", "Water", "Electric", "Psychic", "Ice", "Dragon", "Dark", "Fairy"].includes(x)) throw new RangeError("Invalid type");
else this.#type = x;
}
}
new Pokémon({type: "Fire"});
new Pokémon(JSON.parse("{\"type\": \"Fire\"}"));
new Pokémon({type: "Bird"}); // error
@noracodes by deserialize directly into a class, is Object.assign(struct, { field: "my_data" }) what you mean / are looking for?
U·S Trans Survey, subtoot
@Satsuma yes and i don’t think it is actually helpful for trans advocates to be seen as chronic exaggerators and misrepresenters of data
U·S Trans Survey, subtoot
@Satsuma oh there were a number of incorrect claims but one such was that 41% of trans people live in “the bible belt”
that number was for the entire south, including, for example, the state of delaware
re: bluesky and mastodon meta
@noracodes in fairness eugen wishes mastodon was like this as well, we just didn't let it happen
re: bluesky and mastodon meta
@noracodes my understanding is that bluesky is federated but intentionally designed to give federated nodes absolutely no advantages (moderation, culture) over the main one
re: dusk porn lyconroc re: pokémon evolution; new avatar
@aescling what if girls liked cute things and pokémon and being absolutely covered in cum
re: dusk porn lyconroc re: pokémon evolution; new avatar
dusk porn lyconroc re: pokémon evolution; new avatar
@aescling i like how your favourite porns are the extremely cutesy ones
re: pokémon evolution; new avatar
@aescling disappointing they should get on that
is there any good midday or is that also a bust
where do you go to look for these things
re: pokémon evolution; new avatar
@aescling take you for example
i don’t see you bashing any cop cars and you’re horny as fuck
re: pokémon evolution; new avatar
@aescling how to put this… a lot of the dykes who are big and tough and bashing cop cars in the front lines of protests are like that because they have been hurt before, sometimes romantically or sexually, and consequently can be a lot more temperamental or selective about when or where or why or if they fuck
where as the dykes who are less visibly disruptive and are the loyal and kind and protective types… absolute freaks in bed
re: pokémon evolution; new avatar
@aescling this isn’t even a “i’m attracted to pokémon” take it’s just a “i can read lesbian signalling”
midnight form is all about the streets midday form is all about the sheets
re: pokémon evolution; new avatar
@aescling yeah see everyone is all about midnight form because reasons but i actually think it’s the least hot of the three
Administrator / Public Relations for GlitchCat. Not actually glitchy, nor a cat. I wrote the rules for this instance.
“Constitutionally incapable of not going hard” — @aescling
“Fedi Cassandra” – @Satsuma
I HAVE EXPERIENCE IN THINGS. YOU CAN JUST @ ME.
I work for a library but I post about Zelda fanfiction.