Javascript shorthand function-style regexp calls no longer work in bootstrap addon code, throw "TypeError: /.../ is not a function"

RESOLVED INVALID

Status

()

--
major
RESOLVED INVALID
7 years ago
7 years ago

People

(Reporter: dimsal.public, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 ID:20110615151330

Just noticed that my bootstrap addon is broken in some places after upgrading to Firefox 5, and error console inspection shows errors when using the 

/regexp/(arg)

syntax, throwing TypeError: /regexp/ is not a function. This happens both with regexps literals and variables.

I guess this is due to the recent introduction of JS version coercion in XPIProvider.jsm for bootstrap addon code ("ECMAv5" now used for evalInSandbox for bootstrap addons, though I couldn't find the bug that led to this fix). I'm sure this regexp bug was not intended though.

Also note that my addon passed Mozilla's automatic compatibility escalation to Firefox 5 and this problem was not detected.

I will mark this as major because this Javascript regexp feature is now reportedly commonplace even though it's not in Ecmascript, and there's no indication in documentation that it should not be used in bootstrap addons.

Reproducible: Always
Invalid per bug 582717. We should have included this in the add-on compatibility checks though, did we?
(Reporter)

Comment 3

7 years ago
Sorry, I missed this information in comment 1. 

Unless AMO folks might need this to rectify the compatibility checks, it appears invalid indeed.

The feature in question is still in official MDC docs, so I also posted notice to bug 582717.
We didn't include a check for it. That sort of RE utilization is fairly rare, though. I don't expect us to re-run our compat checks for this. Marking as invalid.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.