tor-browser

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

test_console_eval-02.js (530B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /*
      7 * Check that bound functions can be eagerly evaluated.
      8 */
      9 
     10 add_task(
     11  threadFrontTest(async ({ commands }) => {
     12    await commands.scriptCommand.execute(`
     13      var obj = [1, 2, 3];
     14      var fn = obj.includes.bind(obj, 2);
     15    `);
     16 
     17    const normalResult = await commands.scriptCommand.execute("fn()", {
     18      eager: true,
     19    });
     20    Assert.equal(normalResult.result, true, "normal eval");
     21  })
     22 );