Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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!");