PageRenderTime 16ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/parser/htmlparser/tests/mochitest/file_bug568470-script.sjs

http://github.com/zpao/v8monkey
Unknown | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | 882b93ada10be3f67e0801b5d1cef4c7 MD5 | raw file
 1var timer = null; // Declare outside to prevent premature GC
 2
 3function handleRequest(request, response)
 4{
 5  response.setHeader("Cache-Control", "no-cache", false);
 6  response.setHeader("Content-Type", "text/javascript", false);
 7  response.write("var i = 0;");
 8  response.bodyOutputStream.flush();
 9  response.processAsync();
10  timer = Components.classes["@mozilla.org/timer;1"]
11    .createInstance(Components.interfaces.nsITimer);
12  timer.initWithCallback(function() {
13      response.finish();
14    }, 500, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
15}
16