diff options
Diffstat (limited to 'js/src/tests/js1_5/extensions/regress-237461.js')
-rw-r--r-- | js/src/tests/js1_5/extensions/regress-237461.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/js/src/tests/js1_5/extensions/regress-237461.js b/js/src/tests/js1_5/extensions/regress-237461.js new file mode 100644 index 000000000..c079d5f1f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-237461.js @@ -0,0 +1,46 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 237461; +var summary = 'don\'t crash with nested function collides with var'; +var actual = 'Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function g() +{ + var core = {}; + core.js = {}; + core.js.init = function() + { + var loader = null; + + function loader() {} + }; + return core; +} + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + var s = new Script(""+g.toString()); + try + { + var frozen = s.freeze(); // crash. + printStatus("len:" + frozen.length); + } + catch(e) + { + } +} +actual = 'No Crash'; + +reportCompare(expect, actual, summary); |