js/src/tests/js1_8_5/extensions/clone-regexp.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.

     1 // |reftest| skip-if(!xulRuntime.shell)
     2 // -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     3 // Any copyright is dedicated to the Public Domain.
     4 // http://creativecommons.org/licenses/publicdomain/
     6 function testRegExp(b) {
     7     var a = deserialize(serialize(b));
     8     assertEq(a === b, false);
     9     assertEq(Object.getPrototypeOf(a), RegExp.prototype);
    10     assertEq(Object.prototype.toString.call(a), "[object RegExp]");
    11     for (p in a)
    12         throw new Error("cloned RegExp should have no enumerable properties");
    14     assertEq(a.source, b.source);
    15     assertEq(a.global, b.global);
    16     assertEq(a.ignoreCase, b.ignoreCase);
    17     assertEq(a.multiline, b.multiline);
    18     assertEq(a.sticky, b.sticky);
    19     assertEq("expando" in a, false);
    20 }
    22 testRegExp(RegExp(""));
    23 testRegExp(/(?:)/);
    24 testRegExp(/^(.*)$/gimy);
    25 testRegExp(RegExp.prototype);
    27 var re = /\bx\b/gi;
    28 re.expando = true;
    29 testRegExp(re);
    30 re.__proto__ = {};
    31 testRegExp(re);
    33 reportCompare(0, 0, 'ok');

mercurial