summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/asm.js/bug1268955-usestrict-semantics.js
blob: 501c4392da7b1fa9f1f7eaa76e641dfa1c6c4cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var scope = {};
scope.mod = eval(`"use strict"; (function() { "use asm"; function f() {} return f; });`);

scope.fun = scope.mod();

var caught = false;
for (let callee of ['mod', 'fun']) {
    for (let getter of ['caller', 'arguments']) {
        caught = false;
        try {
            scope[callee][getter];
        } catch (e) {
            caught = true;
            assertEq(e instanceof TypeError, true);
        }
        assertEq(caught, true);
    }
}