View Full Version : Does Function.caller work in Safari?

04-26-2004, 03:16 AM
Hey all,

I'm googled out! This question is a feeler on any information about how Safari implements the Function.caller property. This property works in fox/moz... so why not Safari? Or, if it does, is it done differently?

Here's my simple test, you can paste it in your browsers adddresbar for a quick fix.

javascript:function a(){alert('called by:\n'+a.caller)}function b(){a()}b();

Any help, pointers or tips would be greatly appreciated.

04-26-2004, 10:13 AM
I have no Mac to verify but according to one of the comments in this blog (http://weblogs.mozillazine.org/mt/mt-comments.cgi?entry_id=3198), Function.caller is not supported in Safari.

04-26-2004, 10:54 AM
[function Function].caller and [function Function].arguments (and thus also [function Function].arguments.caller) were deprecated in JavaScript 1.3, and were never in ECMAScript. The caller property of the local arguments vector was deprecated in JavaScript 1.3 as well.

Neither Opera nor Safari support them, and there are no ways of emulating the behavior.

04-26-2004, 11:30 PM
Glad to hear something about this from others. Thanks for the links and information.