summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arrow-functions/strict-1.js
blob: 9bb715a4c9da58bccf5e45d6782a43ba898ffff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// arrow functions are not implicitly strict-mode code

load(libdir + "asserts.js");

var f = a => { with (a) return f(); };
assertEq(f({f: () => 7}), 7);

f = a => function () { with (a) return f(); };
assertEq(f({f: () => 7})(), 7);

f = (a = {x: 1, x: 2}) => b => { "use strict"; return a.x; };
assertEq(f()(0), 2);