forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjQuery.Deferred.getStackHook.xml
More file actions
31 lines (31 loc) · 1.57 KB
/
jQuery.Deferred.getStackHook.xml
File metadata and controls
31 lines (31 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0"?>
<entry type="method" name="jQuery.Deferred.getStackHook" return="Error" deprecated="3.7" removed="4.0">
<title>jQuery.Deferred.getStackHook()</title>
<signature>
<added>3.0</added>
</signature>
<desc>Return an Error instance with a defined stack.</desc>
<longdesc>
<div class="warning">
<p>Note: This API has been deprecated in jQuery 3.7; please use the <a href="/jQuery.Deferred.getErrorHook/"><code>jQuery.Deferred.getErrorHook</code></a> method instead.</p>
</div>
<div class="warning">
<p>Note: This API is not defined by default, but jQuery will make use of it when defined.</p>
</div>
<p>See <a href="/jQuery.Deferred.getErrorHook/"><code>jQuery.Deferred.getErrorHook</code></a> for the context why this API was created. Initially, we advised users to assign to it a function returning an error stack:</p>
<pre><code>
jQuery.Deferred.getStackHook = function() {
try {
throw new Error( "Exception in jQuery.Deferred" );
} catch ( err ) {
return err.stack; // stack property returned here
}
};
</code></pre>
<p>However, when such a stack is then logged by jQuery from inside of <a href="/jQuery.Deferred.exceptionHook/"><code>jQuery.Deferred.exceptionHook</code></a>, the browser won't apply source maps. Therefore, we changed the recommendation to return the full error object itself. To make it clearer, the API was also renamed.</p>
</longdesc>
<category slug="deferred-object"/>
<category slug="version/3.0"/>
<category slug="deprecated/deprecated-3.7"/>
<category slug="removed"/>
</entry>