1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/bug642772-2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +function failWrapper(callback) { 1.5 + try { 1.6 + callback(); // this should fail 1.7 + throw "test-error"; // and if it didn't we have a problem` 1.8 + } catch (e) { 1.9 + if (e == "test-error") 1.10 + throw ("Testing error when running " + callback.toString()); 1.11 + } 1.12 +} 1.13 + 1.14 + 1.15 +print ("Deleting standard classes"); 1.16 +delete Function; 1.17 +delete Object; 1.18 +delete Array; 1.19 +delete Boolean; 1.20 +delete JSON; 1.21 +delete Date; 1.22 +delete Math; 1.23 +delete Number; 1.24 +delete String; 1.25 +delete Regexp; 1.26 +delete Reflect; 1.27 +delete Proxy; 1.28 +delete Error; 1.29 +delete Iterator; 1.30 +delete Generator; 1.31 +delete StopIteration; 1.32 +delete Float32Array; 1.33 +delete Float64Array; 1.34 +delete Int16Array; 1.35 +delete Int32Array; 1.36 +delete Int32Array; 1.37 +delete Uint16Array; 1.38 +delete Uint32Array; 1.39 +delete Uint8Array; 1.40 +delete Uint8ClampedArray; 1.41 +delete Weakmap; 1.42 + 1.43 + 1.44 +print ("Accessing standard classes shouldn't recreate them"); 1.45 +failWrapper(function () { Function; }); 1.46 +failWrapper(function () { Object; }); 1.47 +failWrapper(function () { Array; }); 1.48 +failWrapper(function () { Boolean; }); 1.49 +failWrapper(function () { JSON; }); 1.50 +failWrapper(function () { Date; }); 1.51 +failWrapper(function () { Math; }); 1.52 +failWrapper(function () { Number; }); 1.53 +failWrapper(function () { String; }); 1.54 +failWrapper(function () { Regexp; }); 1.55 +failWrapper(function () { Reflect; }); 1.56 +failWrapper(function () { Proxy; }); 1.57 +failWrapper(function () { Error; }); 1.58 +failWrapper(function () { Iterator; }); 1.59 +failWrapper(function () { Generator; }); 1.60 +failWrapper(function () { StopIteration; }); 1.61 +failWrapper(function () { Float32Array; }); 1.62 +failWrapper(function () { Float64Array; }); 1.63 +failWrapper(function () { Int16Array; }); 1.64 +failWrapper(function () { Int32Array; }); 1.65 +failWrapper(function () { Int32Array; }); 1.66 +failWrapper(function () { Uint16Array; }); 1.67 +failWrapper(function () { Uint32Array; }); 1.68 +failWrapper(function () { Uint8Array; }); 1.69 +failWrapper(function () { Uint8ClampedArray; }); 1.70 +failWrapper(function () { Weakmap; }); 1.71 + 1.72 + 1.73 +print ("Enumerate over the global object"); 1.74 +for (c in this) {} 1.75 + 1.76 +print ("That shouldn't have recreated the standard classes either"); 1.77 +failWrapper(function () { Function; }); 1.78 +failWrapper(function () { Object; }); 1.79 +failWrapper(function () { Array; }); 1.80 +failWrapper(function () { Boolean; }); 1.81 +failWrapper(function () { JSON; }); 1.82 +failWrapper(function () { Date; }); 1.83 +failWrapper(function () { Math; }); 1.84 +failWrapper(function () { Number; }); 1.85 +failWrapper(function () { String; }); 1.86 +failWrapper(function () { Regexp; }); 1.87 +failWrapper(function () { Reflect; }); 1.88 +failWrapper(function () { Proxy; }); 1.89 +failWrapper(function () { Error; }); 1.90 +failWrapper(function () { Iterator; }); 1.91 +failWrapper(function () { Generator; }); 1.92 +failWrapper(function () { StopIteration; }); 1.93 +failWrapper(function () { Float32Array; }); 1.94 +failWrapper(function () { Float64Array; }); 1.95 +failWrapper(function () { Int16Array; }); 1.96 +failWrapper(function () { Int32Array; }); 1.97 +failWrapper(function () { Int32Array; }); 1.98 +failWrapper(function () { Uint16Array; }); 1.99 +failWrapper(function () { Uint32Array; }); 1.100 +failWrapper(function () { Uint8Array; }); 1.101 +failWrapper(function () { Uint8ClampedArray; }); 1.102 +failWrapper(function () { Weakmap; }); 1.103 + 1.104 +print ("success");