Caller:
Functionname.caller returns the caller.
Take a look at the following function, you can copy it to vs under Execute
Copy Code code as follows:
function caller () {
if (Caller.caller) {
Alert (caller.caller.toString ());
} else {
Alert ("Function direct execution");
}
}
function Handlecaller () {
=function (x, y) {var a= "myfunc"; alert (THIS.A); alert (x + y ); } myfunc.call (func, "var", "fun");//"Func" "var Fun" myfunc.apply (func,["var", "fun"]);//"Func" "var fun" three, the caller property returns a reference to a function that invokes the function body of the current function. The FunctionName.caller:functionName object is the name of the function being executed. Description: For a function, the call
, arguments is not an array object.CallerReturns a reference to the function that called the current function.Functionname.callerThe FunctionName object is the name of the function being executed.DescriptionFor a function, the caller property is defined only when the function executes. If the function is called by the top level, then caller contains null. If you use the
Script Language
=
"
Javascript
"
>
/** Demonstrate the usage of arguments and how to obtain real parameters and number of shapes*/
Function
Argtest (A, B, C, D)
{ VaR Numargs = Arguments. length; // Obtain the value of the passed parameter. VaR Expargs = Argtest. length; // Obtain the expected value. Alert ( " The number of real parameters is: " + Numargs)Alert ( " Number of shapes: " + Expargs)Alert (arguments [ 0 ])Alert (argtest [ 0 ]) //
C # obtain Caller information,
When a log component is used, the caller information is often recorded. The caller information is usually obtained through reflection. However,. Net 4.5 introduces three new features: CallerFilePathAttribute, CallerLineNumberAttribute, and CallerMemberNameAttribute. These three features can only be applied to parameters and can onl
Keyword: arguments, callee, callerarguments: the input function parameter callee: The statement of the function and the function body caller: the function that calls the Function
Arguments
This object represents the function being executed and the parameters of the function that calls it.CallerReturns a reference to the function that calls the current function.FunctionName. callerThe functionName object is the name of the executed function.Description
You should use "attributes" to address caller and callee, not methods.Caller: Returns a reference to the function that called the current function. A calls B, then returns a (A is the boss, because a B calls the past to work);Callee: This attribute holds B (b is called past). Returns the function object being executed, which is the body of the specified function object.If the function is called by the top level of the Javascript program, then
There is no call to belong to such calls we do not know where to call, this function is not really okay but have obsessive-compulsive disorder friends may feel to show, then how to open the function of the caller, the specific let's take a look at it.
1. Under the Standby page, click "Application".
2. Click "Set".
3. Slide up the screen and click on "Call".
4. Click on "Caller
Some friends may ask caller, What Is callee? What is the role of javascript? So this article will give some basic introduction to this. It is expected to help you understand callee and caller in javascript.
Callee
Callee is an attribute of an object. It is a pointer pointing to the function of the arguments object.First, we will write a level-1 function:
function chen(x){if (x
It can be seen from this fu
function.FunctionName. callerThe functionName object is the name of the executed function.DescriptionFor a function, the caller attribute is defined only when the function is executed. If the function is called by the top layer, caller contains null. If the caller attribute is used in the string context, the result is the same as functionName. toString, that is,
function, the caller attribute is defined only when the function is executed. If the function is called by the top layer, caller contains null. If the caller attribute is used in the string context, the result is the same as functionname. tostring, that is, the decompilation Text of the function is displayed.The following example illustrates the usage of
is not an array object.
CallerReturns a reference to the function that calls the current function.Functionname. CallerThe functionname object is the name of the executed function.DescriptionFor a function, the caller attribute is defined only when the function is executed. If the function is called by the top layer, caller contains null. If the caller attribut
is, arguments is not an array object.CallerReturns a reference to the function that calls the current function.Functionname. CallerThe functionname object is the name of the executed function.DescriptionFor a function, the caller attribute is defined only when the function is executed. If the function is called by the top layer, caller contains null. If the caller
function B caller calls the function of the current function B to reference a (that is, to the parent function A of the current function B), so the result is a popup function a () {B ();};So you know caller and callee, then you can not combine the two together to use itFunction B () {alert (B.caller);};From this code you can see that the B function called the B function name, so that when the function name
Callee returns the function object being executed, which is the body of the specified Function object[function.] Arguments.callee, the optional function parameter is the name of the function object that is currently executingCaller returns a reference to a functionThe Functionname.caller,functionname object is the name of the function being executedFor a function, the caller property is defined only when the function executes. If the function is calle
This is a creation in
Article, where the information may have evolved or changed.
Package Mainimport"Runtime"Import"Log"Func Main () {test ()}func test () {test2 ()}func test2 () {pc,file,line,ok:= Runtime. Caller (2) log. PRINTLN (PC) log. PRINTLN (file) log. PRINTLN (line) log. Println (OK) F:=Runtime. FUNCFORPC (PC) log. Println (F.name ()) Pc,file,line,ok= Runtime. Caller (0) log. PRINTLN (PC) log. PRIN
CalleeCallee is a property of an object that is a pointer to a function that points to a parameter arguments objectfirst, Let's write a step-up function:Function Chen (x) {If (xReturn 1;} else{return X*chen (x-1);};};From this function can be seen, the use of recursive function, if changed the function name, inside the function name also with the change, this is very inconvenient so we use callee to tryFunction Chen (x) {If (x}else{return X*arguments.callee (x-1);};};Let's analyze why this is wr
arguments object whose value is "the function object being executed."
What does that mean?
Let's write a demo and see how the output turns out.
Code and result graphs see below
From the picture above, Arguments.callee is the function that points to the arguments object of the parameter, here is obj.
What is caller?
Caller is a property of a function object that holds the function that
Show | source code
The following code is the last time I gave a company
Do the management information system used to achieve caller ID source code.
When I got here, I just deleted something that didn't work.
Let's just see it.
If you are interested, you can send letters to sobigapple@qq.com to communicate with me.
I'm a rookie.
Option ExplicitConst DEBFLG = 1
Public COMx, Beepno, Hangup, Pnloc as Integer
Public Combuf, Comlin as StringDim h
Private S
This article as long as the use of the implicit parameters of JS (Arguments,callee,caller) is introduced, the need for friends can come to the reference, I hope to help youBefore referring to the above concepts, I would like to start by saying the implicit parameters of the functions in javascript:ArgumentsArguments the object represents the function being executed and the parameters of the function that called it. [function.] Arguments[n] ParameterFu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.