js/src/jit-test/tests/auto-regress/bug687399.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/auto-regress/bug687399.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +// Binary: cache/js-dbg-64-06445f55f009-linux
     1.5 +// Flags: -m -n -a
     1.6 +//
     1.7 +
     1.8 +if (!this.emulatedJSON) {
     1.9 +    emulatedJSON = function () {
    1.10 +        function stringify(value, whitelist) {
    1.11 +            var a, i, v;
    1.12 +            switch (typeof value) {
    1.13 +            case 'string':
    1.14 +                if (!(value.propertyIsEnumerable('length'))) {
    1.15 +                    for (i = 0; i < l; i += 1) {
    1.16 +                        k = whitelist[i];
    1.17 +                        if (typeof k === 'string') {
    1.18 +                            if (i %= 'not visited') {}
    1.19 +                        }
    1.20 +                    }
    1.21 +                }
    1.22 +            }
    1.23 +        }
    1.24 +        return {
    1.25 +            stringify: stringify,
    1.26 +        };
    1.27 +    }();
    1.28 +    var testPairs = [ ['{"five":5}'] ]
    1.29 +    for (var i = 0; i < testPairs.length; i++) {
    1.30 +        var pair = testPairs[i];
    1.31 +        var s = emulatedJSON.stringify(pair[1])
    1.32 +    }
    1.33 +}

mercurial