2.8.3.3 The [[Get]] (P) Method of a Function Object

When the [[Get]] method of F is called with value P, the following steps are taken:

  1. If P is the string 'arguments', take the following steps:

    1. If an active execution context for F does not exist, go to step 3.

    2. Let X be the most recently created active execution context for F.

    3. If X is marked as having a partially accessible arguments object, let A be the original arguments object for X; otherwise, let A be the value of the property named 'arguments' of the variable object of X.

      Note: JScript 5.x under Internet Explorer 9 (in all document modes) marks the current execution context as having a partially accessible arguments object when the function’s FormalParameterList contains the name 'arguments' or the function’s FunctionBody contains a direct reference to the function’s original arguments object or the function’s FunctionBody  contains a direct call to eval.

    4. Return A.

  2. If P is the string 'caller', take the following steps:

    1. Let X be the most recently created active execution context for F.

    2. If X does not have an execution context to which it could normally exit, return null.

    3. Let R be the execution context which would become the current execution context if X exited normally (not via an exception).

    4. If R is an execution context for a built-in function or a host object function, return null.

    5. If R is an execution context for global code or for eval code, return null.

    6. R must be an execution context for function code, so let rf be the function object that contains the call that caused R to be created.

    7. If rf is a strict mode Function object, throw a TypeError exception.

    8. Return rf.

  3. Return the result of calling the default [[Get]] method ([ECMA-262/5] section 8.12.3), passing P as the argument.

Show: