Closed creynders closed 11 years ago
Heya. There's no way to reflect over function references in AS3 unfortunately. Also, injecting into an existing object would be dangerous. So, I think the current implementation makes the most sense. But you're right about the docs - they could certainly be a bit more explicit about the conditions under which injection takes place.
There seems to be a potentially confusing situation with hooks: when a class is passed its dependencies are injected, but with functions and objects this is not the case. If this is WAI then I think this should be made clear in the documentation. I'm not entirely sure whether it would be possible to inject into an anonymous function for instance, but certainly with mapped classes some kind of clarification is necessary. For instance:
You would expect
Bar
to be injected, wouldn't you? Or am I slowly but steadily stumbling into cuckoo-land here?If you want I can take a look and see what I come up with.