tor-browser

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

function-bind.js (723B)


      1 // |reftest| skip-if(!this.uneval)
      2 
      3 /*
      4 * Any copyright is dedicated to the Public Domain.
      5 * http://creativecommons.org/licenses/publicdomain/
      6 */
      7 
      8 var gTestfile = 'function-bind.js';
      9 var BUGNUMBER = 429507;
     10 var summary = "ES5: Function.prototype.bind";
     11 
     12 print(BUGNUMBER + ": " + summary);
     13 
     14 /**************
     15 * BEGIN TEST *
     16 **************/
     17 
     18 assertEq((function unbound(){"body"}).bind().toSource(), `function bound() {
     19    [native code]
     20 }`);
     21 
     22 assertEq(uneval((function unbound(){"body"}).bind()), `function bound() {
     23    [native code]
     24 }`);
     25 
     26 
     27 /******************************************************************************/
     28 
     29 if (typeof reportCompare === "function")
     30  reportCompare(true, true);
     31 
     32 print("All tests passed!");