Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: regex.test() returning false in Firefox but true in other browsers

23 views
Skip to first unread message

Benjamin Smedberg

unread,
Jan 24, 2012, 1:49:37 PM1/24/12
to Michael A. Puls II, dev-apps...@lists.mozilla.org
On 1/20/12 9:14 AM, Michael A. Puls II wrote:
> Object.defineProperty(String.prototype, "com_example_bool", {
> get : function() {
> return (/^(true|1)$/i).test(this);
> }
> });
> alert("true".com_example_bool);
>
> That returns true in Opera, IE9, Chrome Canary and Safari, but returns
> false in Firefox (at least latest trunk).
>
> Anyone know why?
Because I haven't seen a reply to this, I went ahead and filed bug
720760. This doesn't appear to be related to the regexes, but instead
the `this` object for the getter function.

--BDS

Michael A. Puls II

unread,
Jan 24, 2012, 2:11:13 PM1/24/12
to Benjamin Smedberg, dev-apps...@lists.mozilla.org
Thanks. With your help, I added a simplified pass/fail tc. (But as
mentioned in the comments, the system doesn't want to give a text/html
mime type for the attachment. Not sure why, has always worked fine the
zillion times I've done it before.)

--
Michael
0 new messages