js/src/tests/ecma_3/FunExpr/regress-545980.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:054648905a2b
1 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 */
5
6 var BUGNUMBER = 518103;
7 var summary = 'partial flat closures must not reach across funargs';
8 var actual = "no crash";
9 var expect = actual;
10
11 function Timer(){}
12 Timer.prototype = { initWithCallback: function (o) {Timer.q.push(o)} };
13 Timer.q = [];
14
15 var later;
16 var ac = {startSearch: function(q,s,n,o){later=o}};
17
18 var bm = {insertBookmark: function(){}, getIdForItemAt: function(){}};
19
20 function run_test() {
21 var tagIds = [];
22
23 (function doSearch(query) {
24 ac.startSearch(query, "", null, {
25 onSearchResult: function() {
26 var num = tagIds.length;
27
28 var timer = new Timer;
29 var next = query.slice(1);
30 timer.initWithCallback({ notify: function() doSearch(next) });
31 }
32 });
33 })("title");
34 }
35
36 run_test();
37 later.onSearchResult();
38 for (var i in Timer.q)
39 Timer.q[i].notify();
40
41 reportCompare(expect, actual, summary);

mercurial