some sort of AOP, but really this is just a dynamic extension of loader. Return value is not relevant since this is a constructor.

Yes, we need to patch the loader before anything else happens.

Yes, better name, and better structure is needed, I will propose a trully dynamic extension, e.g.:

```
if (o.doBeforeLoader) {
     o.doBeforeLoader.apply(this, arguments);
}
```

I don't think we need to pass `Y` into the method since there is a property of `this` called `context` that is set as part of the class definition.