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

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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);

mercurial