js/src/tests/js1_5/Regress/regress-254974.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:bc64d2c5fa30
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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);

mercurial