There's some odd behavior with the RegExp "test" method. With the
global flag, calls to test which should return true actually
alternately return true and false:
js> r = RegExp("asdf", "g");
/asdf/g
js> r.test("asdf")
true
js> r.test("asdf")
false
js> r.test("asdf")
true
js> r.test("asdf")
false
...
("Rhino 1.6 release 7 2007 08 19")
Without the global flag it always works correctly, and if test should
return false it always does.
Is this a bug? I don't know of any other regex implementations with
this behavior. I don't think there's any reason to set the global flag
when using test(), but I also don't think it should break it.
Thanks,
Tom Robinson
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino