michael@0: // |reftest| skip michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: Jason Orendorff michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 415721; michael@0: var summary = 'jsatom.c double hashing re-validation logic is unsound'; michael@0: michael@0: printStatus (summary); michael@0: michael@0: var VARS = 10000; michael@0: var TRIES = 100; michael@0: michael@0: function atomizeStressTest() { michael@0: var fn = "function f() {var "; michael@0: for (var i = 0; i < VARS; i++) michael@0: fn += '_f' + i + ', '; michael@0: fn += 'q;}'; michael@0: michael@0: function e() { eval(fn); } michael@0: michael@0: for (var i = 0; i < TRIES; i++) { michael@0: scatter([e,e]); michael@0: gc(); michael@0: } michael@0: } michael@0: michael@0: var expect; michael@0: var actual; michael@0: michael@0: expect = actual = 'No crash'; michael@0: if (typeof scatter == 'undefined' || typeof gc == 'undefined') { michael@0: print('Test skipped. scatter or gc not defined.'); michael@0: expect = actual = 'Test skipped.'; michael@0: } else { michael@0: atomizeStressTest(); michael@0: } michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: