regress-375711.js (1814B)
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 = 375711; 8 var summary = 'Do not assert with /[Q-b]/i.exec("")'; 9 var actual = ''; 10 var expect = ''; 11 12 13 //----------------------------------------------------------------------------- 14 test(); 15 //----------------------------------------------------------------------------- 16 17 function test() 18 { 19 printBugNumber(BUGNUMBER); 20 printStatus (summary); 21 22 var s; 23 24 // see bug 416933 25 print('see bug 416933 for changed behavior on Gecko 1.9'); 26 27 try 28 { 29 s = '/[Q-b]/.exec("")'; 30 expect = 'No Error'; 31 print(s + ' expect ' + expect); 32 eval(s); 33 actual = 'No Error'; 34 } 35 catch(ex) 36 { 37 actual = ex + ''; 38 } 39 reportCompare(expect, actual, summary + ': ' + s); 40 41 try 42 { 43 s ='/[Q-b]/i.exec("")'; 44 expect = 'No Error'; 45 print(s + ' expect ' + expect); 46 eval(s); 47 actual = 'No Error'; 48 } 49 catch(ex) 50 { 51 actual = ex + ''; 52 } 53 reportCompare(expect, actual, summary + ': ' + s); 54 55 try 56 { 57 s = '/[q-b]/.exec("")'; 58 expect = 'SyntaxError: invalid range in character class'; 59 print(s + ' expect ' + expect); 60 eval(s); 61 actual = 'No Error'; 62 } 63 catch(ex) 64 { 65 actual = ex + ''; 66 } 67 reportCompare(expect, actual, summary + ': ' + s); 68 69 try 70 { 71 s ='/[q-b]/i.exec("")'; 72 expect = 'SyntaxError: invalid range in character class'; 73 print(s + ' expect ' + expect); 74 eval(s); 75 actual = 'No Error'; 76 } 77 catch(ex) 78 { 79 actual = ex + ''; 80 } 81 reportCompare(expect, actual, summary + ': ' + s); 82 }