| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | var gTestfile = 'regress-419018.js'; |
| 7 | //----------------------------------------------------------------------------- |
| 8 | var BUGNUMBER = 419018; |
| 9 | var summary = 'UMR in JSENUMERATE_INIT'; |
| 10 | var actual = 'No Crash'; |
| 11 | var expect = 'No Crash'; |
| 12 | |
| 13 | //----------------------------------------------------------------------------- |
| 14 | test(); |
| 15 | //----------------------------------------------------------------------------- |
| 16 | |
| 17 | function test() |
| 18 | { |
| 19 | enterFunc ('test'); |
| 20 | printBugNumber(BUGNUMBER); |
| 21 | printStatus (summary); |
| 22 | |
| 23 | print('This test must be run under valgrind to check if an UMR occurs in slowarray_enumerate'); |
| 24 | |
| 25 | try |
| 26 | { |
| 27 | function parse() { |
| 28 | var a = []; // need array init |
| 29 | a["b"] = 1; // need to set obj property |
| 30 | return a; |
| 31 | } |
| 32 | // var c; // can't declare c |
| 33 | // var d = {}; // can't add this (weird!) |
| 34 | // var d = ""; // nor this |
| 35 | var x = parse(""); // won't crash without string arg (weird!) |
| 36 | // var d = ""; // nor here |
| 37 | for (var o in x) |
| 38 | c[o]; // need to look up o in undefined object |
| 39 | } |
| 40 | catch(ex) |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | reportCompare(expect, actual, summary); |
| 45 | |
| 46 | exitFunc ('test'); |
| 47 | } |
| 48 |