tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

lazy-flag-consistency.js (1130B)


      1 // These tests highlight potential differences between the lazy and non-lazy
      2 // parse modes. The delazification process should be able to assert that script
      3 // flags are consistent.
      4 
      5 function dead_inner_function_1() {
      6    (function() {})
      7 }
      8 dead_inner_function_1();
      9 
     10 function dead_inner_function_2() {
     11    if (false) {
     12        function inner() {}
     13    }
     14 }
     15 dead_inner_function_2();
     16 
     17 function inner_eval_1() {
     18    eval("");
     19 }
     20 inner_eval_1();
     21 
     22 function inner_eval_2() {
     23    (function() {
     24        eval("");
     25    })
     26 }
     27 inner_eval_2();
     28 
     29 function inner_eval_3() {
     30    (() => eval(""));
     31 }
     32 inner_eval_3();
     33 
     34 function inner_delete_1() {
     35    var x;
     36    (function() { delete x; })
     37 }
     38 inner_delete_1();
     39 
     40 function inner_delete_2() {
     41    var x;
     42    (() => delete x);
     43 }
     44 inner_delete_2();
     45 
     46 function inner_this_1() {
     47    (() => this);
     48 }
     49 inner_this_1();
     50 
     51 function inner_arguments_1() {
     52    (() => arguments);
     53 }
     54 inner_arguments_1();
     55 
     56 function constructor_wrapper_1() {
     57    return (function() {
     58        this.initialize.apply(this, arguments);
     59    });
     60 }
     61 constructor_wrapper_1();
     62 
     63 var runonce_lazy_1 = function (){}();
     64 
     65 var runonce_lazy_2 = function* (){}();