An alternative to using arguments.calleeis simply the name of the function, as such:
arguments.callee
// Snippet 1, using arguments.callee: (function(){ document.body.innerHTML += 'qwe'; setTimeout(arguments.callee, 1); })() // Snippet 2, using naming: (function f(){ document.body.innerHTML += 'qwe'; setTimeout(f, 1); })()
What stops the JavaScript engine / compiler from automatically optimizing Snippet 1 in Snippet 2 above? Is there any inherent limitation?
The MDN argument basically boils down to:
.. arguments.calleesignificantly complicates optimization, for example, the embedding of functions, since it is necessary to provide a link to the un-inlined function, if access to arguments.callee.
However, if we manually call this function and call it through this name, we already provide a link to this function and, thus, “impede optimizations such as nesting functions”.
Olliej " [] [ , ]". , (. ).
, arguments.callee?
, MDN " - "; , : " , arguments.callee - ".
( , , arguments.callee , arguments, this , , , . , , MDN .)
arguments
this
Source: https://habr.com/ru/post/1538821/More articles:Cannot start a new project with Android Studio - androidDifference between dequeueReusableCellWithReuseIdentifier: and cellForItemAtIndexPath: - ioshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1538818/why-code-with-object-fails-to-complile-when-the-same-code-with-object-works&usg=ALkJrhgPa2SqpODl4geF5LGGvEoVmcNB3AHow can I determine in what mode my pub transformer works? - dartSWT: how to make a rounded border label - javaEmber.js: access properties in the "parent" controller when using the {{render}} helper - ember.jsHow to execute a query based on the "date" column in sqlite3 using sequelize? - node.jsиспользование тяги:: сортировка внутри потока - cudaCan we change the JVM thread scheduler? - javaHow do you use special letters (Danish) in R-studio? - rAll Articles