js/src/tests/ecma_5/Global/adding-global-var-nonextensible-error.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
     2 // Any copyright is dedicated to the Public Domain.
     3 // http://creativecommons.org/licenses/publicdomain/
     5 //-----------------------------------------------------------------------------
     6 var BUGNUMBER = 621432;
     7 var summary =
     8   "If a var statement can't create a global property because the global " +
     9   "object isn't extensible, and an error is thrown while decompiling the " +
    10   "global, don't assert";
    12 print(BUGNUMBER + ": " + summary);
    14 /**************
    15  * BEGIN TEST *
    16  **************/
    18 var toSource = [];
    19 Object.preventExtensions(this);
    21 try
    22 {
    23   eval("var x;");
    24   throw new Error("no error thrown");
    25 }
    26 catch (e)
    27 {
    28   reportCompare(e instanceof TypeError, true, "expected TypeError, got: " + e);
    29 }
    31 /******************************************************************************/
    33 if (typeof reportCompare === "function")
    34   reportCompare(true, true);
    36 print("All tests passed!");

mercurial