Note that there are some explanatory texts on larger screens.

plurals
  1. POasync.series: memory leak of feature?
    primarykey
    data
    text
    <p>I'm studying use <code>series.js</code>. I wrote simple example - run <code>async.series</code> for 3 functions. By curiosity I created log output before and after callback call. Unexpected for me there is no log messages 'after callback'. </p> <p>My question is - is it memory leak, and these call are still in stack and waiting to return? Or <code>async.js</code> uses special mechanism for cutting functions after callback? I tried to read <code>async.js</code> source and found nothing. </p> <p>Is there any ideas?</p> <p>Test page:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8" /&gt; &lt;title&gt;My Page&lt;/title&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://raw.github.com/caolan/async/master/lib/async.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var a = function (callback) { console.log('a before callback'); return callback(null); console.log('a after callback'); }; var b = function (callback) { console.log('b before callback'); return callback(null); console.log('b after callback'); }; var c = function (callback) { console.log('c before callback'); return callback(null); console.log('c after callback'); }; var doit = function() { console.log('click'); async.series([a, b, c, a, b, c], function(something) {console.log('async.series happy end: '+something);}); console.log('series finished'); }; $(function() { $('#bu').click(doit); }); console.log('hello'); &lt;/script&gt; &lt;/head&gt; &lt;body id="bo" class="blue"&gt; &lt;input type="button" id="bu" value="click"&gt;&lt;br /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Log output:</p> <pre><code>hello event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. click a before callback b before callback c before callback a before callback b before callback c before callback async.series happy end: null series finished </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload