summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/testDelArg3Strict.js
blob: 77d247a4d86b36b33bc426081a6c65a569897f12 (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
43
44
"use strict";

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);
    }
})()();