Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | * http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 4 | */ |
michael@0 | 5 | |
michael@0 | 6 | var BUGNUMBER = 518103; |
michael@0 | 7 | var summary = 'partial flat closures must not reach across funargs'; |
michael@0 | 8 | var actual = "no crash"; |
michael@0 | 9 | var expect = actual; |
michael@0 | 10 | |
michael@0 | 11 | function Timer(){} |
michael@0 | 12 | Timer.prototype = { initWithCallback: function (o) {Timer.q.push(o)} }; |
michael@0 | 13 | Timer.q = []; |
michael@0 | 14 | |
michael@0 | 15 | var later; |
michael@0 | 16 | var ac = {startSearch: function(q,s,n,o){later=o}}; |
michael@0 | 17 | |
michael@0 | 18 | var bm = {insertBookmark: function(){}, getIdForItemAt: function(){}}; |
michael@0 | 19 | |
michael@0 | 20 | function run_test() { |
michael@0 | 21 | var tagIds = []; |
michael@0 | 22 | |
michael@0 | 23 | (function doSearch(query) { |
michael@0 | 24 | ac.startSearch(query, "", null, { |
michael@0 | 25 | onSearchResult: function() { |
michael@0 | 26 | var num = tagIds.length; |
michael@0 | 27 | |
michael@0 | 28 | var timer = new Timer; |
michael@0 | 29 | var next = query.slice(1); |
michael@0 | 30 | timer.initWithCallback({ notify: function() doSearch(next) }); |
michael@0 | 31 | } |
michael@0 | 32 | }); |
michael@0 | 33 | })("title"); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | run_test(); |
michael@0 | 37 | later.onSearchResult(); |
michael@0 | 38 | for (var i in Timer.q) |
michael@0 | 39 | Timer.q[i].notify(); |
michael@0 | 40 | |
michael@0 | 41 | reportCompare(expect, actual, summary); |