Posted in Javascript onMay 07, 2015
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');
JS中获取函数调用链所有参数的方法
- Author -
junjie声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@