4 ms·
JavaScript Symbol.thenable Proposal
- tantalor 8y agoIf this property would override default behavior, then it should be set to true, not false, i.e., not_thenable=true instead of thenable=false.
- wilg 8y agoNot sure I buy that. Seems like avoiding the double negative is worthwhile. Not all default values need to be false, do they?
- voldemort1968 8y agoAgreed. It's a bad UX convention even; such as error alerts reading "Are you sure you want to not save the document? [YES] [NO]"
- optimuspaul 8y agoIf you consider that not setting it results in undefined which would evaluate to false then they are correct. But I don't think that needs to be the case. In reality you can default to whatever you want in which case I agree with you.
- saagarjha 8y agoWill this thing really be called "thenable"? Has nobody suggested a better name?
- twiss 8y agoThis would also solve the case of objects that pretend to have every property as a function, e.g.: https://github.com/slmgc/Nothing https://github.com/slmgc/Nothing
- JBReefer 8y agoBut why?
- vec 8y agoCan we not introduce a dirty hack into the formal specification solely to work around an edge case introduced by another dirty hack that's already in the formal specification?