michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: var BUGNUMBER = 518103; michael@0: var summary = 'partial flat closures must not reach across funargs'; michael@0: var actual = "no crash"; michael@0: var expect = actual; michael@0: michael@0: function Timer(){} michael@0: Timer.prototype = { initWithCallback: function (o) {Timer.q.push(o)} }; michael@0: Timer.q = []; michael@0: michael@0: var later; michael@0: var ac = {startSearch: function(q,s,n,o){later=o}}; michael@0: michael@0: var bm = {insertBookmark: function(){}, getIdForItemAt: function(){}}; michael@0: michael@0: function run_test() { michael@0: var tagIds = []; michael@0: michael@0: (function doSearch(query) { michael@0: ac.startSearch(query, "", null, { michael@0: onSearchResult: function() { michael@0: var num = tagIds.length; michael@0: michael@0: var timer = new Timer; michael@0: var next = query.slice(1); michael@0: timer.initWithCallback({ notify: function() doSearch(next) }); michael@0: } michael@0: }); michael@0: })("title"); michael@0: } michael@0: michael@0: run_test(); michael@0: later.onSearchResult(); michael@0: for (var i in Timer.q) michael@0: Timer.q[i].notify(); michael@0: michael@0: reportCompare(expect, actual, summary);