Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | "use strict"; |
michael@0 | 2 | |
michael@0 | 3 | let global = this; |
michael@0 | 4 | let p = {}; |
michael@0 | 5 | let q = {}; |
michael@0 | 6 | |
michael@0 | 7 | let g1 = function() { |
michael@0 | 8 | assertEq(this, undefined); |
michael@0 | 9 | }; |
michael@0 | 10 | g1(...[]); |
michael@0 | 11 | |
michael@0 | 12 | let g2 = x => { |
michael@0 | 13 | assertEq(this, global); |
michael@0 | 14 | }; |
michael@0 | 15 | g2(...[]); |
michael@0 | 16 | |
michael@0 | 17 | let g3 = function() { |
michael@0 | 18 | assertEq(this, p); |
michael@0 | 19 | }; |
michael@0 | 20 | g3.apply(p, ...[]); |
michael@0 | 21 | g3.call(p, ...[]); |
michael@0 | 22 | |
michael@0 | 23 | g2.apply(p, ...[]); |
michael@0 | 24 | g2.call(p, ...[]); |
michael@0 | 25 | |
michael@0 | 26 | let o = { |
michael@0 | 27 | f1: function() { |
michael@0 | 28 | assertEq(this, o); |
michael@0 | 29 | |
michael@0 | 30 | let g1 = function() { |
michael@0 | 31 | assertEq(this, undefined); |
michael@0 | 32 | }; |
michael@0 | 33 | g1(...[]); |
michael@0 | 34 | |
michael@0 | 35 | let g2 = x => { |
michael@0 | 36 | assertEq(this, o); |
michael@0 | 37 | }; |
michael@0 | 38 | g2(...[]); |
michael@0 | 39 | |
michael@0 | 40 | let g3 = function() { |
michael@0 | 41 | assertEq(this, q); |
michael@0 | 42 | }; |
michael@0 | 43 | g3.apply(q, ...[]); |
michael@0 | 44 | g3.call(q, ...[]); |
michael@0 | 45 | |
michael@0 | 46 | let g4 = x => { |
michael@0 | 47 | assertEq(this, o); |
michael@0 | 48 | }; |
michael@0 | 49 | g4.apply(q, ...[]); |
michael@0 | 50 | g4.call(q, ...[]); |
michael@0 | 51 | }, |
michael@0 | 52 | f2: x => { |
michael@0 | 53 | assertEq(this, global); |
michael@0 | 54 | let g1 = function() { |
michael@0 | 55 | assertEq(this, undefined); |
michael@0 | 56 | }; |
michael@0 | 57 | g1(...[]); |
michael@0 | 58 | |
michael@0 | 59 | let g2 = x => { |
michael@0 | 60 | assertEq(this, global); |
michael@0 | 61 | }; |
michael@0 | 62 | g2(...[]); |
michael@0 | 63 | |
michael@0 | 64 | let g3 = function() { |
michael@0 | 65 | assertEq(this, q); |
michael@0 | 66 | }; |
michael@0 | 67 | g3.apply(q, ...[]); |
michael@0 | 68 | g3.call(q, ...[]); |
michael@0 | 69 | |
michael@0 | 70 | let g4 = x => { |
michael@0 | 71 | assertEq(this, global); |
michael@0 | 72 | }; |
michael@0 | 73 | g4.apply(q, ...[]); |
michael@0 | 74 | g4.call(q, ...[]); |
michael@0 | 75 | }, |
michael@0 | 76 | f3: function() { |
michael@0 | 77 | assertEq(this, p); |
michael@0 | 78 | |
michael@0 | 79 | let g1 = function() { |
michael@0 | 80 | assertEq(this, undefined); |
michael@0 | 81 | }; |
michael@0 | 82 | g1(...[]); |
michael@0 | 83 | |
michael@0 | 84 | let g2 = x => { |
michael@0 | 85 | assertEq(this, p); |
michael@0 | 86 | }; |
michael@0 | 87 | g2(...[]); |
michael@0 | 88 | |
michael@0 | 89 | let g3 = function() { |
michael@0 | 90 | assertEq(this, q); |
michael@0 | 91 | }; |
michael@0 | 92 | g3.apply(q, ...[]); |
michael@0 | 93 | g3.call(q, ...[]); |
michael@0 | 94 | |
michael@0 | 95 | let g4 = x => { |
michael@0 | 96 | assertEq(this, p); |
michael@0 | 97 | }; |
michael@0 | 98 | g4.apply(q, ...[]); |
michael@0 | 99 | g4.call(q, ...[]); |
michael@0 | 100 | } |
michael@0 | 101 | }; |
michael@0 | 102 | o.f1(...[]); |
michael@0 | 103 | o.f2(...[]); |
michael@0 | 104 | o.f3.apply(p, ...[]); |
michael@0 | 105 | o.f2.apply(p, ...[]); |