summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/testDelArg3.js
blob: 4931870bbcdd84afb31ec221888a3c9acf92f111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function assertGood(x) {
    assertEq(x, "good");
}

(function() {
    var a = arguments;
    return function() {
        assertGood.apply(null, a);
    }
})("good")();

(function() {
    var a = arguments;
    return function() {
        a[0] = "good";
        assertGood.apply(null, a);
    }
})("bad")();

Object.prototype[0] = "good";

(function() {
    var a = arguments;
    return function() {
        delete a[0];
        assertGood.apply(null, a);
    }
})("bad")();

delete Object.prototype[0];

function assertUndefined(x) {
    assertEq(x, undefined);
}

(function() {
    var a = arguments;
    return function() {
        a[0] = "bad";
        assertUndefined.apply(null, a);
    }
})()();