js/src/tests/ecma_5/Global/adding-global-var-nonextensible-error.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     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