tor-browser

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

keys-testing.js (2190B)


      1 function f(o) {
      2    return Object.keys(o)
      3 }
      4 
      5 po = {
      6    failure: 'hello'
      7 }
      8 
      9 o = {about: 5,
     10    ballisitic: 6,
     11    cakebread: 8,
     12    dalespeople: 9,
     13    evilproof: 20,
     14    fairgoing: 30,
     15    gargoylish: 2,
     16    harmonici: 1,
     17    jinniwink: 12,
     18    kaleidoscopical: 2,
     19    labellum: 1,
     20    macadamization: 4,
     21    neutrino: 1,
     22    observership: 0,
     23    quadratomandibular: 9,
     24    rachicentesis: 1,
     25    saltcat: 0,
     26    trousseau: 1,
     27    view: 10,
     28    wheelbox: 2,
     29    xerography: 1,
     30    yez: 3,
     31 }
     32 Object.setPrototypeOf(o, po);
     33 
     34 // Initialize for-in cache for o.
     35 for (var prop in o) {
     36    print(prop)
     37 }
     38 
     39 function test(o) {
     40    for (var i = 0; i<10; i++) {
     41        res = f(o);
     42        assertEq(false, res.includes("failure") );
     43        // assertEq(true, res.includes("1") );
     44    }
     45 }
     46 
     47 // Verify things.
     48 test(o)
     49 
     50 
     51 po[2] = "hi";
     52 test(o);
     53 
     54 po[3] = "bye";
     55 for (var prop in o) {
     56    assertEq(prop == "gnome", false);
     57 }
     58 test(o);
     59 
     60 
     61 o2 = {about: 5,
     62    ballisitic: 6,
     63    cakebread: 8,
     64    dalespeople: 9,
     65    evilproof: 20,
     66    fairgoing: 30,
     67    gargoylish: 2,
     68    harmonici: 1,
     69    jinniwink: 12,
     70    kaleidoscopical: 2,
     71    labellum: 1,
     72    macadamization: 4,
     73    neutrino: 1,
     74    observership: 0,
     75    quadratomandibular: 9,
     76    rachicentesis: 1,
     77    saltcat: 0,
     78    trousseau: 1,
     79    view: 10,
     80    wheelbox: 2,
     81    xerography: 1,
     82    yez: 3,
     83    "1": 10,
     84 }
     85 
     86 // Initialize for-in cache for o.
     87 for (var prop in o2) {
     88    if (prop == "abra") print(prop);
     89 }
     90 
     91 // Verify things.
     92 test(o2)
     93 
     94 
     95 for (var i = 0; i < 20; i++) {
     96    assertEq(Object.keys(o2).includes("1"), true);
     97 }
     98 
     99 let o3 = {about: 5,
    100    ballisitic: 6,
    101    cakebread: 8,
    102    dalespeople: 9,
    103    evilproof: 20,
    104    fairgoing: 30,
    105    gargoylish: 2,
    106    harmonici: 1,
    107    jinniwink: 12,
    108    kaleidoscopical: 2,
    109    labellum: 1,
    110    macadamization: 4,
    111    neutrino: 1,
    112    observership: 0,
    113    quadratomandibular: 9,
    114    rachicentesis: 1,
    115    saltcat: 0,
    116    trousseau: 1,
    117    view: 10,
    118    wheelbox: 2,
    119    xerography: 1,
    120    yez: 3,
    121 }
    122 
    123 // Initialize for-in cache for o.
    124 for (var prop in o2) {
    125    if (prop == "abra") print(prop);
    126 }
    127 
    128 // Verify things.
    129 test(o3)
    130 
    131 
    132 for (var i = 0; i < 20; i++) {
    133    assertEq(Object.keys(o3).includes("yez"), true);
    134 }