Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
1 // |reftest| skip-if(!xulRuntime.shell)
3 // Any copyright is dedicated to the Public Domain.
4 // http://creativecommons.org/licenses/publicdomain/
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 822041;
8 var summary = "Live generators should not cache SPS state";
10 print(BUGNUMBER + ": " + summary);
12 function gen() {
13 var x = yield turnoff();
14 yield x;
15 yield 'bye';
16 }
18 function turnoff() {
19 print("Turning off profiler\n");
20 disableSPSProfiling();
21 return 'hi';
22 }
24 for (var slowAsserts of [ true, false ]) {
25 // The slowAssertions setting is not expected to matter
26 enableSPSProfilingAssertions(slowAsserts);
28 g = gen();
29 assertEq(g.next(), 'hi');
30 assertEq(g.send('gurgitating...'), 'gurgitating...');
31 for (var x in g)
32 assertEq(x, 'bye');
33 }
35 // This is really a crashtest
36 reportCompare(0, 0, 'ok');