method modifiers in addition to "bind"

David Bruant bruant.d at gmail.com
Thu Feb 16 00:38:42 PST 2012


Le 16/02/2012 03:32, Peter Seliger a écrit :
>
>
>     that looks like a wrap to me ... what's the connection with bind()
>     exactly?
>
>     Also not sure you are talking about dispatched Events ("before",
>     "around", "after") or some other topic
>
>
> Sorry for not having pointed it out clearly enough.
> I'm talking about before/after/around as they are
> known from Aspect Oriented Programming.
>
> The connection to bind, I thought, was that all of
> them do modify other methods. Therefore I did
> choose the above subject instead of mentioning
> AOP in the first place.
Can you show some examples of what it would look like?
Is there a widespread use of such constructs in JavaScript? I can't 
recall having seen such things.

A while ago, I did start a library using "before", for a sort of runtime 
type checking (replacing a function with another function that does the 
same thing, but with type checking for both input and output). Having 
started such a thing, I soon realized it was hard to use my library in a 
non-intrusive way (probably a good use case for macros).

I'm not sure to what extent my experience reflects how the general use 
case for methods modifiers in JS would be, though.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120216/1128fe67/attachment.html>


More information about the es-discuss mailing list