js/src/tests/js1_8_5/regress/regress-533876.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_5/regress/regress-533876.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +/*
     1.5 + * Any copyright is dedicated to the Public Domain.
     1.6 + * http://creativecommons.org/licenses/publicdomain/
     1.7 + * Contributors: Gary Kwong and Jason Orendorff
     1.8 + */
     1.9 +
    1.10 +var savedEval = eval;
    1.11 +var x = [0];
    1.12 +eval();
    1.13 +
    1.14 +x.__proto__ = this;  // x has non-dictionary scope
    1.15 +try {
    1.16 +    DIE;
    1.17 +} catch(e) {
    1.18 +}
    1.19 +
    1.20 +delete eval;  // force dictionary scope for global
    1.21 +gc();
    1.22 +eval = savedEval;
    1.23 +var f = eval("(function () { return /x/; })");
    1.24 +x.watch('x', f);  // clone property from global to x, including SPROP_IN_DICTIONARY flag
    1.25 +
    1.26 +reportCompare("ok", "ok", "bug 533876");

mercurial