regress-375183.js (1210B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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 //----------------------------------------------------------------------------- 7 var BUGNUMBER = 375183; 8 var summary = '__noSuchMethod__ should not allocate beyond fp->script->depth'; 9 var actual = 'No Crash'; 10 var expect = 'No Crash'; 11 12 13 //----------------------------------------------------------------------------- 14 test(); 15 //----------------------------------------------------------------------------- 16 17 function test() 18 { 19 printBugNumber(BUGNUMBER); 20 printStatus (summary); 21 22 var obj = { get __noSuchMethod__() { 23 print("Executed"); 24 return new Object(); 25 }}; 26 27 try 28 { 29 obj.x(); 30 } 31 catch(ex) 32 { 33 } 34 35 reportCompare(expect, actual, summary + ':1'); 36 37 obj = { __noSuchMethod__: {} }; 38 try 39 { 40 obj.x(); 41 } 42 catch(ex) 43 { 44 } 45 46 reportCompare(expect, actual, summary + ':2'); 47 48 obj = { } 49 obj.__noSuchMethod__ = {}; 50 try 51 { 52 obj.x(); 53 } 54 catch(ex) 55 { 56 } 57 58 reportCompare(expect, actual, summary + ':3'); 59 }