js/src/tests/ecma_3_1/RegExp/regress-305064.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 // |reftest| fails
michael@0 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 //-----------------------------------------------------------------------------
michael@0 8 var BUGNUMBER = 305064;
michael@0 9 var summary = 'CharacterClassEscape \\s';
michael@0 10 var actual = '';
michael@0 11 var expect = '';
michael@0 12
michael@0 13 //-----------------------------------------------------------------------------
michael@0 14 test();
michael@0 15 //-----------------------------------------------------------------------------
michael@0 16
michael@0 17 function test()
michael@0 18 {
michael@0 19 enterFunc ('test');
michael@0 20 printBugNumber(BUGNUMBER);
michael@0 21 printStatus (summary);
michael@0 22
michael@0 23 /** List from ES 3.1 Recommendation for String.trim (bug 305064) **/
michael@0 24 var whitespace = [
michael@0 25 {s : '\u0009', t : 'HORIZONTAL TAB'},
michael@0 26 {s : '\u000B', t : 'VERTICAL TAB'},
michael@0 27 {s : '\u000C', t : 'FORMFEED'},
michael@0 28 {s : '\u0020', t : 'SPACE'},
michael@0 29 {s : '\u00A0', t : 'NO-BREAK SPACE'},
michael@0 30 {s : '\u1680', t : 'OGHAM SPACE MARK'},
michael@0 31 {s : '\u180E', t : 'MONGOLIAN VOWEL SEPARATOR'},
michael@0 32 {s : '\u2000', t : 'EN QUAD'},
michael@0 33 {s : '\u2001', t : 'EM QUAD'},
michael@0 34 {s : '\u2002', t : 'EN SPACE'},
michael@0 35 {s : '\u2003', t : 'EM SPACE'},
michael@0 36 {s : '\u2004', t : 'THREE-PER-EM SPACE'},
michael@0 37 {s : '\u2005', t : 'FOUR-PER-EM SPACE'},
michael@0 38 {s : '\u2006', t : 'SIX-PER-EM SPACE'},
michael@0 39 {s : '\u2007', t : 'FIGURE SPACE'},
michael@0 40 {s : '\u2008', t : 'PUNCTUATION SPACE'},
michael@0 41 {s : '\u2009', t : 'THIN SPACE'},
michael@0 42 {s : '\u200A', t : 'HAIR SPACE'},
michael@0 43 {s : '\u202F', t : 'NARROW NO-BREAK SPACE'},
michael@0 44 {s : '\u205F', t : 'MEDIUM MATHEMATICAL SPACE'},
michael@0 45 {s : '\u3000', t : 'IDEOGRAPHIC SPACE'},
michael@0 46 {s : '\u000A', t : 'LINE FEED OR NEW LINE'},
michael@0 47 {s : '\u000D', t : 'CARRIAGE RETURN'},
michael@0 48 {s : '\u2028', t : 'LINE SEPARATOR'},
michael@0 49 {s : '\u2029', t : 'PARAGRAPH SEPARATOR'},
michael@0 50 {s : '\u200B', t : 'ZERO WIDTH SPACE (category Cf)'}
michael@0 51 ];
michael@0 52
michael@0 53 for (var i = 0; i < whitespace.length; ++i)
michael@0 54 {
michael@0 55 var v = whitespace[i];
michael@0 56 reportCompare(true, !!(/\s/.test(v.s)), 'Is ' + v.t + ' a space');
michael@0 57 }
michael@0 58
michael@0 59 exitFunc ('test');
michael@0 60 }

mercurial