Closed Bug 453635 Opened 14 years ago Closed 14 years ago

regular expression handling

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 98409

People

(Reporter: dwight.smith, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1

Save the html code below as an html file and load it into the browser and watch the javascript alert alternate between true, false, true, false rather than 10 times true
#############################

<html>
<head>
<script type="text/javascript">

window.onload=function()
{

  for(var i = 0; i < 10; i++)
  {
    var stringToTest = "In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell";
    var regExp = /there lived a hobbit/g;
    var result = regExp.test(stringToTest);
    alert(result);
  }
  
}


</script>

</head>
  
<body>
howdy
</body>

</html>

Reproducible: Always

Steps to Reproduce:
1.
2.
3.


Expected Results:  
the javascript alert should say true 10 times
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: regexpliteralflaw
You need to log in before you can comment on or make changes to this bug.