michael@0: // |reftest| skip-if(!xulRuntime.shell) 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 = 822041; michael@0: var summary = "Live generators should not cache SPS state"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: function gen() { michael@0: var x = yield turnoff(); michael@0: yield x; michael@0: yield 'bye'; michael@0: } michael@0: michael@0: function turnoff() { michael@0: print("Turning off profiler\n"); michael@0: disableSPSProfiling(); michael@0: return 'hi'; michael@0: } michael@0: michael@0: for (var slowAsserts of [ true, false ]) { michael@0: // The slowAssertions setting is not expected to matter michael@0: enableSPSProfilingAssertions(slowAsserts); michael@0: michael@0: g = gen(); michael@0: assertEq(g.next(), 'hi'); michael@0: assertEq(g.send('gurgitating...'), 'gurgitating...'); michael@0: for (var x in g) michael@0: assertEq(x, 'bye'); michael@0: } michael@0: michael@0: // This is really a crashtest michael@0: reportCompare(0, 0, 'ok');