You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zhangnan05 edited this page Sep 2, 2014
·
1 revision
layout: page
title: 获取function调用链所有参数
{% include JB/setup %}
function getCallerArgument(){
var result = [];
var slice = Array.prototype.slice;
var caller = arguments.callee.caller;
while(caller){
result = result.concat(slice.call(caller.arguments, 0));
caller = caller.arguments.callee.caller;
}
return result;
};
var a = function(){b('a1','a2')},
b = function(){b('b1','b2')},
c= function(){return getCallerArgument()};
c('c1');