How does self in a Shim work

How does self['marked'] work in this copied shim? It works fine but where can I read how this works? Is it correct?

Thanks! Needed that.