Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

function caller?

9 views
Skip to first unread message

Marc Guillemot

unread,
Jan 25, 2008, 3:09:38 PM1/25/08
to
Hi,

in browsers something like:
----------
function myFunc() {
alert(myFunc.caller)
}
myFunc()
function foo() { myFunc() }
foo()
----------
will alert "null" and "function foo() { ...".

Rhino doesn't support this and it seems not to be in the ECMA standard.

Would you accept this in some way in Rhino?

Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com

Norris Boyd

unread,
Jan 25, 2008, 4:16:37 PM1/25/08
to

I intentionally left this out since it was non-ECMA and the caller-
callee pair can only be supported by creating a call frame for every
invocation, which would have a significant negative impact on
performance for compiled code.

An option would be to support in interpreter mode only, although I've
tried to avoid having any functionality differences between the two
modes.

So how important is this as a feature?

--N

Marc Guillemot

unread,
Jan 28, 2008, 4:54:15 AM1/28/08
to

interpreted mode would be ok for us.
The feature is as always important for HtmlUnit but for instance less
than the properties order in ScriptableObject ;-)

0 new messages