tor-browser

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

regress-254974.js (1182B)


      1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 //-----------------------------------------------------------------------------
      7 // this test originally was only seen if typed into the js shell.
      8 // loading as a script file did not exhibit the problem.
      9 // this test case may not exercise the problem properly.
     10 
     11 var BUGNUMBER = 254974;
     12 var summary = 'all var and arg properties should be JSPROP_SHARED';
     13 var actual = '';
     14 var expect = '';
     15 
     16 printBugNumber(BUGNUMBER);
     17 printStatus (summary);
     18 
     19 function testfunc(tokens) {
     20  function eek(y) {} /* remove function eek and the code will change its behavior */
     21  return tokens.split(/\]?(?:\[|$)/).shift();
     22 }
     23 bad=testfunc;
     24 function testfunc(tokens) {
     25  return tokens.split(/\]?(?:\[|$)/).shift();
     26 }
     27 good=testfunc;
     28 
     29 var goodvalue = good("DIV[@id=\"test\"]");
     30 var badvalue = bad("DIV[@id=\"test\"]");
     31 
     32 printStatus(goodvalue);
     33 printStatus(badvalue);
     34 
     35 expect = goodvalue;
     36 actual = badvalue;
     37 
     38 reportCompare(expect, actual, summary);