summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/bug-888002-2.js
blob: f0ccfca998333c42a0626651e5a6544501a908c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Constant folding doesn't affect non-strict delete.

(function (x) {
    // These senseless delete-expressions are legal. Per ES5.1 11.4.1 step 2,
    // each one does nothing and returns true.
    assertEq(delete (1 ? x : x), true);
    assertEq(delete (0 || x), true);
    assertEq(delete (1 && x), true);

    // This one is legal too, but returns false.
    assertEq(delete x, false);
}());