tor-browser

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

try-access.js (663B)


      1 // A function trying to access to |w| through a "CrossOrigin" attribute (blur).
      2 // This function is kept in its own file to ensure the source location of the
      3 // call stays constant.
      4 function tryAccess(w) {
      5  try {
      6    w.blur();
      7  } catch(e) {}
      8 }
      9 
     10 function assert_source_location_found(report) {
     11  assert_true(report.body.sourceFile.includes("try-access.js"));
     12  assert_equals(report.body.lineNumber, 6);
     13  assert_equals(report.body.columnNumber, 7);
     14 }
     15 
     16 function assert_source_location_missing(report) {
     17  assert_equals(report.body.sourceFile, undefined);
     18  assert_equals(report.body.lineNumber, undefined);
     19  assert_equals(report.body.columnNumber, undefined);
     20 }