cujojs / meld

AOP for JS with before, around, on, afterReturning, afterThrowing, after advice, and pointcuts
Other
644 stars 65 forks source link

why meld need push joinpoint to stack and remove it #21

Closed enginespot closed 11 years ago

enginespot commented 11 years ago

the follow code, first push joinpoint to a stack , and then remove it

so why?

// TODO: Use Object.freeze once v8 perf problem is fixed
                joinpoint = pushJoinpoint({
                    target: context,
                    method: method,
                    args: args,
                    proceed: proceedCall,
                    proceedApply: proceedApply,
                    proceedCount: proceedCount
                });

                try {
                    // Call supplied around advice function
                    return around.call(context, joinpoint);
                } finally {
                    popJoinpoint();
                }
briancavalier commented 11 years ago

This question was answered here on the cujoJS google group.