Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- {
- Hello();
- }
- function Hello()
- {
- // How do you find out the caller function is 'main'?
- }
- function Hello()
- {
- alert("caller is " + arguments.callee.caller.toString());
- }
- function Hello() {
- alert("caller is " + arguments.callee.caller.toString());
- }
- function Hello() {
- alert("caller is " + Hello.caller.toString());
- }
- var Klass = function kls() {
- this.Hello = function() { alert(printStackTrace().join('nn')); };
- }
- new Klass().Hello();
- arguments.callee.caller.name
- arguments.callee.caller.toString();
- arguments.callee.caller
- arguments.callee.caller.caller
- arguments.callee.caller.caller.caller
- function Hello() {
- alert(Hello.caller);
- }
Add Comment
Please, Sign In to add comment