js/src/jit-test/tests/arguments/testDelArg3.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/arguments/testDelArg3.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +function assertGood(x) {
     1.5 +    assertEq(x, "good");
     1.6 +}
     1.7 +
     1.8 +(function() {
     1.9 +    var a = arguments;
    1.10 +    return function() {
    1.11 +        assertGood.apply(null, a);
    1.12 +    }
    1.13 +})("good")();
    1.14 +
    1.15 +(function() {
    1.16 +    var a = arguments;
    1.17 +    return function() {
    1.18 +        a[0] = "good";
    1.19 +        assertGood.apply(null, a);
    1.20 +    }
    1.21 +})("bad")();
    1.22 +
    1.23 +Object.prototype[0] = "good";
    1.24 +
    1.25 +(function() {
    1.26 +    var a = arguments;
    1.27 +    return function() {
    1.28 +        delete a[0];
    1.29 +        assertGood.apply(null, a);
    1.30 +    }
    1.31 +})("bad")();
    1.32 +
    1.33 +delete Object.prototype[0];
    1.34 +
    1.35 +function assertUndefined(x) {
    1.36 +    assertEq(x, undefined);
    1.37 +}
    1.38 +
    1.39 +(function() {
    1.40 +    var a = arguments;
    1.41 +    return function() {
    1.42 +        a[0] = "bad";
    1.43 +        assertUndefined.apply(null, a);
    1.44 +    }
    1.45 +})()();

mercurial