29 ms·
The descriptor protocol is definitely magic! It normally doesn't matter that it's magic because most people don't need to interact with it. And it causes a ver
by quietbritishjim 6y ago
The descriptor protocol is definitely magic!
It normally doesn't matter that it's magic because most people don't need to interact with it. And it causes a very intuitive result in the part of the language that most people actually do interact with: that x = obj.foo; x() is the same as obj.foo() (not true in Javascript!). But that doesn't change the fact that method binding happens in a more complex way under the hood than you'd expect.