| OLD | NEW | 
| (Empty) |  | 
 |    1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 
 |    2 /* ***** BEGIN LICENSE BLOCK ***** | 
 |    3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 
 |    4  * | 
 |    5  * The contents of this file are subject to the Mozilla Public License Version | 
 |    6  * 1.1 (the "License"); you may not use this file except in compliance with | 
 |    7  * the License. You may obtain a copy of the License at | 
 |    8  * http://www.mozilla.org/MPL/ | 
 |    9  * | 
 |   10  * Software distributed under the License is distributed on an "AS IS" basis, | 
 |   11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 
 |   12  * for the specific language governing rights and limitations under the | 
 |   13  * License. | 
 |   14  * | 
 |   15  * The Original Code is JavaScript Engine testing utilities. | 
 |   16  * | 
 |   17  * The Initial Developer of the Original Code is | 
 |   18  * Mozilla Foundation. | 
 |   19  * Portions created by the Initial Developer are Copyright (C) 2007 | 
 |   20  * the Initial Developer. All Rights Reserved. | 
 |   21  * | 
 |   22  * Contributor(s): Dave Mandelin <dmandelin@mozilla.com> | 
 |   23  * | 
 |   24  * Alternatively, the contents of this file may be used under the terms of | 
 |   25  * either the GNU General Public License Version 2 or later (the "GPL"), or | 
 |   26  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | 
 |   27  * in which case the provisions of the GPL or the LGPL are applicable instead | 
 |   28  * of those above. If you wish to allow use of your version of this file only | 
 |   29  * under the terms of either the GPL or the LGPL, and not to allow others to | 
 |   30  * use your version of this file under the terms of the MPL, indicate your | 
 |   31  * decision by deleting the provisions above and replace them with the notice | 
 |   32  * and other provisions required by the GPL or the LGPL. If you do not delete | 
 |   33  * the provisions above, a recipient may use your version of this file under | 
 |   34  * the terms of any one of the MPL, the GPL or the LGPL. | 
 |   35  * | 
 |   36  * ***** END LICENSE BLOCK ***** */ | 
 |   37  | 
 |   38 var gTestfile = 'regress-465862.js'; | 
 |   39 //----------------------------------------------------------------------------- | 
 |   40 var BUGNUMBER = 465862; | 
 |   41 var summary = 'Do case-insensitive matching correctly in JIT for non-ASCII-lette
     rs'; | 
 |   42  | 
 |   43 var i = 0; | 
 |   44 var status = ''; | 
 |   45 var statusmessages = new Array(); | 
 |   46 var pattern = ''; | 
 |   47 var patterns = new Array(); | 
 |   48 var string = ''; | 
 |   49 var strings = new Array(); | 
 |   50 var actualmatch = ''; | 
 |   51 var actualmatches = new Array(); | 
 |   52 var expectedmatch = ''; | 
 |   53 var expectedmatches = new Array(); | 
 |   54  | 
 |   55 // Note: we must call the RegExp constructor here instead of using | 
 |   56 // literals. Otherwise, because the regexps are compiled at parse | 
 |   57 // time, they will not be compiled to native code and we will not | 
 |   58 // actually be testing jitted regexps. | 
 |   59  | 
 |   60 jit(true); | 
 |   61  | 
 |   62 status = inSection(1); | 
 |   63 string = '@'; | 
 |   64 pattern = new RegExp('@', 'i'); | 
 |   65 actualmatch = string.match(pattern); | 
 |   66 expectedmatch = Array(string); | 
 |   67 addThis(); | 
 |   68  | 
 |   69 status = inSection(2); | 
 |   70 string = '`'; | 
 |   71 pattern = new RegExp('`', 'i'); | 
 |   72 actualmatch = string.match(pattern); | 
 |   73 expectedmatch = Array(string); | 
 |   74 addThis(); | 
 |   75  | 
 |   76 status = inSection(3); | 
 |   77 string = '@'; | 
 |   78 pattern = new RegExp('`', 'i'); | 
 |   79 actualmatch = string.match(pattern); | 
 |   80 expectedmatch = null; | 
 |   81 addThis(); | 
 |   82  | 
 |   83 status = inSection(4); | 
 |   84 string = '`'; | 
 |   85 pattern = new RegExp('@', 'i'); | 
 |   86 print(string + ' ' + pattern); | 
 |   87 actualmatch = string.match(pattern); | 
 |   88 print('z ' + actualmatch); | 
 |   89 print('`'.match(/@/i)); | 
 |   90 expectedmatch = null; | 
 |   91 addThis(); | 
 |   92  | 
 |   93 jit(false); | 
 |   94  | 
 |   95 //----------------------------------------------------------------------------- | 
 |   96 test(); | 
 |   97 //----------------------------------------------------------------------------- | 
 |   98  | 
 |   99 function addThis() | 
 |  100 { | 
 |  101   statusmessages[i] = status; | 
 |  102   patterns[i] = pattern; | 
 |  103   strings[i] = string; | 
 |  104   actualmatches[i] = actualmatch; | 
 |  105   expectedmatches[i] = expectedmatch; | 
 |  106   i++; | 
 |  107 } | 
 |  108  | 
 |  109  | 
 |  110 function test() | 
 |  111 { | 
 |  112   enterFunc ('test'); | 
 |  113   printBugNumber(BUGNUMBER); | 
 |  114   printStatus (summary); | 
 |  115   testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); | 
 |  116   exitFunc ('test'); | 
 |  117 } | 
| OLD | NEW |