summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/script-tests/strict-readonly-statics.js
blob: ada8e655fd7a9ae5e35097a513239c068fc4db09 (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
description(
"This tests that a assigning to a readonly property in a static or symbol table throws in strict mode."
);

function testWindowUndefined()
{
    "use strict";
    try {
         window.undefined = 42;
    } catch (e) {
        return e instanceof TypeError;
    }
    return false;
}

function testNumberMAX_VALUE()
{
    "use strict";
    try {
         Number.MAX_VALUE = 42;
    } catch (e) {
        return e instanceof TypeError;
    }
    return false;
}

shouldBeTrue('testWindowUndefined()');
shouldBeTrue('testNumberMAX_VALUE()');