Hi,
Currently I am using
argument.callee.caller.arguments
to get the arguments of the caller function, but Firefox complains that
arguments (of Function) is deprecated.
Is there a way to get the arguments of the calling function in a
non-deprecated way?
I use this to do type-safe validation of the parameters by calling a
special validate function at the beginning of some javascript functions
and it really helped me. And now I just noticed it gave deprecated
warnings in my Firefox in strict javascript mode.
Of course I can pass the local arguments to the validate function, but I
want to keep each call to validate as easy to use as possible.
Thanks for any comments.
Robert. 9 3316
post some code and results
"idiot"
"Robert" <ro****@noreply.x> wrote in message
news:43***********************@news.xs4all.nl... Hi,
Currently I am using argument.callee.caller.arguments to get the arguments of the caller function, but Firefox complains that arguments (of Function) is deprecated.
Is there a way to get the arguments of the calling function in a non-deprecated way?
I use this to do type-safe validation of the parameters by calling a special validate function at the beginning of some javascript functions and it really helped me. And now I just noticed it gave deprecated warnings in my Firefox in strict javascript mode. Of course I can pass the local arguments to the validate function, but I want to keep each call to validate as easy to use as possible.
Thanks for any comments.
Robert.
commercial wrote: "Robert" <ro****@noreply.x> wrote in messageIs there a way to get the arguments of the calling function in a non-deprecated way? post some code and results
I posted all the code that is relevant to my question
argument.callee.caller.arguments
"idiot"
Interesting signature.
I am no expert on this, but you could try emulating the arguments
property of Function:-
function f1(a)
{
arguments.callee.arguments=arguments;
f2();
}
function f2()
{
alert(arguments.callee.caller.arguments[0]);
}
commercial said the following on 9/29/2005 4:05 AM: post some code and results
Learn to read and no code is needed for that question.
"idiot"
Talking about one's self is not a sign of intelligence.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Robert wrote: Hi,
Currently I am using argument.callee.caller.arguments to get the arguments of the caller function, but Firefox complains that arguments (of Function) is deprecated.
But doesn't tell you that the - caller - property is a JavaScript(tm)
feature, non-standardised and certainly not cross-browser?
Is there a way to get the arguments of the calling function in a non-deprecated way?
No, a function's arguments are only exposed inside the function by ECMA
262, and there is no - caller - property of either the function or its
arguments.
<snip> ... . And now I just noticed it gave deprecated warnings in my Firefox in strict javascript mode.
<snip>
Switch strict warnings off. There are not suitable for general browser
scripting and some are irrational and/or factually incorrect.
Richard.
Richard Cornford said the following on 9/29/2005 4:51 PM: Robert wrote:
Hi,
<snip>
Is there a way to get the arguments of the calling function in a non-deprecated way?
No, a function's arguments are only exposed inside the function by ECMA 262, and there is no - caller - property of either the function or its arguments.
Whether or not ECMA says it should be exposed or not is irrelevant. If
Mozilla based browsers expose it, then it exposes it. If IE exposes it,
then it exposes it. If they don't, then they don't. And it has nothing
to do with ECMA.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Richard Cornford wrote: Robert wrote:
Hi,
Currently I am using argument.callee.caller.arguments to get the arguments of the caller function, but Firefox complains that arguments (of Function) is deprecated.
But doesn't tell you that the - caller - property is a JavaScript(tm) feature, non-standardised and certainly not cross-browser?
That's right. It does not tell me this. Is there a way to get the arguments of the calling function in a non-deprecated way?
No,
Well that's too bad. I don't mind that some things get deprecated, but
why deprecate something without any means to achieve the same
functionality in another way....
Robert.
Robert wrote: Richard Cornford wrote: Robert wrote:
<snip>Is there a way to get the arguments of the calling function in a non-deprecated way?
No,
Well that's too bad. I don't mind that some things get deprecated, but why deprecate something without any means to achieve the same functionality in another way....
There is nothing stopping you passing the - arguments - of one function
as an argument to another. So where you call a function that then
attempts to access it's callers arguments you can instead pass those
arguments to the function you call.
Richard. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: klaus triendl |
last post by:
hi,
recently i discovered a memory leak in our code; after some investigation i
could reduce it to the following problem:
return objects of functions are handled as temporary objects, hence...
|
by: Mario |
last post by:
Hello,
I couldn't find a solution to the following problem (tried
google and dejanews), maybe I'm using the wrong keywords?
Is there a way to open a file (a linux fifo pipe actually) in...
|
by: Yves Glodt |
last post by:
Hello,
if I do this:
for row in sqlsth:
________pkcolumns.append(row.strip())
________etc
without a prior:
|
by: Adrian Herscu |
last post by:
Hi all,
In which circumstances it is appropriate to declare methods as non-virtual?
Thanx,
Adrian.
|
by: Bern McCarty |
last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains
other than the default AppDomain? Is there any means at all of doing this?
Mixed-mode is incredibly convenient, but if I...
|
by: Patrick Kowalzick |
last post by:
Dear all,
I have an existing piece of code with a struct with some PODs.
struct A
{
int x;
int y;
};
|
by: ypjofficial |
last post by:
Hello All,
So far I have been reading that in case of a polymorphic class ( having
at least one virtual function in it), the virtual function call get
resolved at run time and during that the...
|
by: Ian825 |
last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
|
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= |
last post by:
PEP 1 specifies that PEP authors need to collect feedback from the
community. As the author of PEP 3131, I'd like to encourage comments
to the PEP included below, either here (comp.lang.python), or...
|
by: puzzlecracker |
last post by:
is it even possible or/and there is a better alternative to accept
input in a nonblocking manner?
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |