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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial