js/src/jit-test/tests/arguments/testDelArg3Strict.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/testDelArg3Strict.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +"use strict";
     1.5 +
     1.6 +function assertGood(x) {
     1.7 +    assertEq(x, "good");
     1.8 +}
     1.9 +
    1.10 +(function() {
    1.11 +    var a = arguments;
    1.12 +    return function() {
    1.13 +        assertGood.apply(null, a);
    1.14 +    }
    1.15 +})("good")();
    1.16 +
    1.17 +(function() {
    1.18 +    var a = arguments;
    1.19 +    return function() {
    1.20 +        a[0] = "good";
    1.21 +        assertGood.apply(null, a);
    1.22 +    }
    1.23 +})("bad")();
    1.24 +
    1.25 +Object.prototype[0] = "good";
    1.26 +
    1.27 +(function() {
    1.28 +    var a = arguments;
    1.29 +    return function() {
    1.30 +        delete a[0];
    1.31 +        assertGood.apply(null, a);
    1.32 +    }
    1.33 +})("bad")();
    1.34 +
    1.35 +delete Object.prototype[0];
    1.36 +
    1.37 +function assertUndefined(x) {
    1.38 +    assertEq(x, undefined);
    1.39 +}
    1.40 +
    1.41 +(function() {
    1.42 +    var a = arguments;
    1.43 +    return function() {
    1.44 +        a[0] = "bad";
    1.45 +        assertUndefined.apply(null, a);
    1.46 +    }
    1.47 +})()();

mercurial