diff options
author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/ca/web/javascript/reference/global_objects/function/caller/index.html | |
parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
download | translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2 translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip |
remove retired locales (#699)
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/function/caller/index.html')
-rw-r--r-- | files/ca/web/javascript/reference/global_objects/function/caller/index.html | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/function/caller/index.html b/files/ca/web/javascript/reference/global_objects/function/caller/index.html deleted file mode 100644 index 613e163d6a..0000000000 --- a/files/ca/web/javascript/reference/global_objects/function/caller/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: Function.caller -slug: Web/JavaScript/Reference/Global_Objects/Function/caller -translation_of: Web/JavaScript/Reference/Global_Objects/Function/caller ---- -<div>{{JSRef}} {{non-standard_header}}</div> - -<p>La propietat <code><strong><em>function</em>.caller</strong></code> retorna la funció que ha invocat la funció especificada.</p> - -<h2 id="Descripció">Descripció</h2> - -<p>SI la funció <code>f</code> ha estat invocada pel codi de nivell superior, el valor de <code>f.caller</code> és {{jsxref("null")}}, sinó és la funció que ha cridat <code>f</code>.</p> - -<p>Aquesta propietat reemplaça la propietat obsoleta {{jsxref("Functions/arguments/caller", "arguments.caller")}} de l'objecte {{jsxref("Functions/arguments", "arguments")}}.</p> - -<p>La propietat especial <code>__caller__</code>, la qual retorna l'objecte activatwhich returned the activation object of the caller thus allowing to reconstruct the stack, was removed for security reasons.</p> - -<h3 id="Notes">Notes</h3> - -<p>Vegeu que en cas de recursió, no podeu reconstruir la pila de crida fent servir aquesta propietat. C that in case of recursion, you can't reconstruct the call stack using this property. Tingueu en compte:</p> - -<pre class="brush: js">function f(n) { g(n - 1); } -function g(n) { if (n > 0) { f(n); } else { stop(); } } -f(2); -</pre> - -<p>At the moment <code>stop()</code> is called the call stack will be:</p> - -<pre class="brush: js">f(2) -> g(1) -> f(1) -> g(0) -> stop() -</pre> - -<p>El següent és cert:</p> - -<pre class="brush: js">stop.caller === g && f.caller === g && g.caller === f -</pre> - -<p>so if you tried to get the stack trace in the <code>stop()</code> function like this:</p> - -<pre class="brush: js">var f = stop; -var stack = 'Stack trace:'; -while (f) { - stack += '\n' + f.name; - f = f.caller; -} -</pre> - -<p>El bucle mai s'aturaria.</p> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Checking_the_value_of_a_function's_caller_property">Checking the value of a function's <code>caller</code> property</h3> - -<p>El codi següent comprova que el valor following code checks the value a function's <code>caller</code> property.</p> - -<pre class="brush: js">function myFunc() { - if (myFunc.caller == null) { - return 'The function was called from the top!'; - } else { - return 'This function\'s caller was ' + myFunc.caller; - } -} -</pre> - -<h2 id="Especificacions">Especificacions</h2> - -<p>No forma part de cap especificació. Implementat en JavaScript 1.5.</p> - -<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoDesktop("1.0")}}</td> - <td>8.0</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Chrome per Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatGeckoMobile("1.0")}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li>Error d'Implementació de SpiderMonkey {{bug(65683)}}</li> -</ul> |