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 | function failWrapper(callback) { |
michael@0 | 2 | try { |
michael@0 | 3 | callback(); // this should fail |
michael@0 | 4 | throw "test-error"; // and if it didn't we have a problem` |
michael@0 | 5 | } catch (e) { |
michael@0 | 6 | if (e == "test-error") |
michael@0 | 7 | throw ("Testing error when running " + callback.toString()); |
michael@0 | 8 | } |
michael@0 | 9 | } |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | print ("Deleting standard classes"); |
michael@0 | 13 | delete Function; |
michael@0 | 14 | delete Object; |
michael@0 | 15 | delete Array; |
michael@0 | 16 | delete Boolean; |
michael@0 | 17 | delete JSON; |
michael@0 | 18 | delete Date; |
michael@0 | 19 | delete Math; |
michael@0 | 20 | delete Number; |
michael@0 | 21 | delete String; |
michael@0 | 22 | delete Regexp; |
michael@0 | 23 | delete Reflect; |
michael@0 | 24 | delete Proxy; |
michael@0 | 25 | delete Error; |
michael@0 | 26 | delete Iterator; |
michael@0 | 27 | delete Generator; |
michael@0 | 28 | delete StopIteration; |
michael@0 | 29 | delete Float32Array; |
michael@0 | 30 | delete Float64Array; |
michael@0 | 31 | delete Int16Array; |
michael@0 | 32 | delete Int32Array; |
michael@0 | 33 | delete Int32Array; |
michael@0 | 34 | delete Uint16Array; |
michael@0 | 35 | delete Uint32Array; |
michael@0 | 36 | delete Uint8Array; |
michael@0 | 37 | delete Uint8ClampedArray; |
michael@0 | 38 | delete Weakmap; |
michael@0 | 39 | |
michael@0 | 40 | |
michael@0 | 41 | print ("Accessing standard classes shouldn't recreate them"); |
michael@0 | 42 | failWrapper(function () { Function; }); |
michael@0 | 43 | failWrapper(function () { Object; }); |
michael@0 | 44 | failWrapper(function () { Array; }); |
michael@0 | 45 | failWrapper(function () { Boolean; }); |
michael@0 | 46 | failWrapper(function () { JSON; }); |
michael@0 | 47 | failWrapper(function () { Date; }); |
michael@0 | 48 | failWrapper(function () { Math; }); |
michael@0 | 49 | failWrapper(function () { Number; }); |
michael@0 | 50 | failWrapper(function () { String; }); |
michael@0 | 51 | failWrapper(function () { Regexp; }); |
michael@0 | 52 | failWrapper(function () { Reflect; }); |
michael@0 | 53 | failWrapper(function () { Proxy; }); |
michael@0 | 54 | failWrapper(function () { Error; }); |
michael@0 | 55 | failWrapper(function () { Iterator; }); |
michael@0 | 56 | failWrapper(function () { Generator; }); |
michael@0 | 57 | failWrapper(function () { StopIteration; }); |
michael@0 | 58 | failWrapper(function () { Float32Array; }); |
michael@0 | 59 | failWrapper(function () { Float64Array; }); |
michael@0 | 60 | failWrapper(function () { Int16Array; }); |
michael@0 | 61 | failWrapper(function () { Int32Array; }); |
michael@0 | 62 | failWrapper(function () { Int32Array; }); |
michael@0 | 63 | failWrapper(function () { Uint16Array; }); |
michael@0 | 64 | failWrapper(function () { Uint32Array; }); |
michael@0 | 65 | failWrapper(function () { Uint8Array; }); |
michael@0 | 66 | failWrapper(function () { Uint8ClampedArray; }); |
michael@0 | 67 | failWrapper(function () { Weakmap; }); |
michael@0 | 68 | |
michael@0 | 69 | |
michael@0 | 70 | print ("Enumerate over the global object"); |
michael@0 | 71 | for (c in this) {} |
michael@0 | 72 | |
michael@0 | 73 | print ("That shouldn't have recreated the standard classes either"); |
michael@0 | 74 | failWrapper(function () { Function; }); |
michael@0 | 75 | failWrapper(function () { Object; }); |
michael@0 | 76 | failWrapper(function () { Array; }); |
michael@0 | 77 | failWrapper(function () { Boolean; }); |
michael@0 | 78 | failWrapper(function () { JSON; }); |
michael@0 | 79 | failWrapper(function () { Date; }); |
michael@0 | 80 | failWrapper(function () { Math; }); |
michael@0 | 81 | failWrapper(function () { Number; }); |
michael@0 | 82 | failWrapper(function () { String; }); |
michael@0 | 83 | failWrapper(function () { Regexp; }); |
michael@0 | 84 | failWrapper(function () { Reflect; }); |
michael@0 | 85 | failWrapper(function () { Proxy; }); |
michael@0 | 86 | failWrapper(function () { Error; }); |
michael@0 | 87 | failWrapper(function () { Iterator; }); |
michael@0 | 88 | failWrapper(function () { Generator; }); |
michael@0 | 89 | failWrapper(function () { StopIteration; }); |
michael@0 | 90 | failWrapper(function () { Float32Array; }); |
michael@0 | 91 | failWrapper(function () { Float64Array; }); |
michael@0 | 92 | failWrapper(function () { Int16Array; }); |
michael@0 | 93 | failWrapper(function () { Int32Array; }); |
michael@0 | 94 | failWrapper(function () { Int32Array; }); |
michael@0 | 95 | failWrapper(function () { Uint16Array; }); |
michael@0 | 96 | failWrapper(function () { Uint32Array; }); |
michael@0 | 97 | failWrapper(function () { Uint8Array; }); |
michael@0 | 98 | failWrapper(function () { Uint8ClampedArray; }); |
michael@0 | 99 | failWrapper(function () { Weakmap; }); |
michael@0 | 100 | |
michael@0 | 101 | print ("success"); |