41 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Both ``++arguments.caller++`` and ``++arguments.callee++`` make quite a few optimizations impossible so they were deprecated in latest versions of JavaScript. In fact, EcmaScript 5 forbids the use of both in ``++strict++`` mode, according to the docs:
____
Arguments objects for strict mode functions define non-configurable accessor properties named "caller" and "callee" which throw a TypeError exception on access.
____
The same restriction applies to the function's ``++caller++`` and ``++arguments++`` properties in ``++strict++`` mode.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,javascript]
2021-04-28 16:49:39 +02:00
----
function whoCalled() {
if (arguments.caller == null) //Noncompliant
console.log('I was called from the global scope.');
else
console.log(arguments.caller + ' called me!'); // Noncompliant
console.log(whoCalled.caller); // Noncompliant
console.log(whoCalled.arguments); // Noncompliant
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]