Closed Bug 508553 Opened 15 years ago Closed 12 years ago

Need a way to enable JSOPTION_RELIMIT for an XPCOM component

Categories

(Core :: JavaScript Engine, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jwkbugzilla, Unassigned)

References

Details

Bug 330569 introduced a way to guard against exponential regular expressions. This would be very useful to catch mistakes made by Adblock Plus users (like bug 508542). Unfortunately, it seems that the javascript.options.relimit preference is only considered for JS contexts that are associated with a window. Similarly, there is nothing comparable to window._options.relimit on BackstagePass - so there is no way to enable this option for an XPCOM component (and neither for a JS module I guess). Ideally it would be possible to enable this option for a single XPCOM component so that waiting for bug 452451 isn't necessary.
My recent tests with FF 7.0.1 suggest that the problem might have been resolved--at least as far as Bug 508542 is concerned.
I cannot confirm that. The regexp engine is a lot faster than it was in Firefox 3.0 but javascript.options.relimit doesn't seem to have any effect at all in Firefox 7.0.1 - no matter what regular expression I try it doesn't throw. This is even true if I run the following: /a*a*a*a*a*a*a*b/.test("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); This will hang (especially if I make the tested string longer) but it doesn't throw an exception. For me it looks like bug 330569 regressed.
Depends on: 696723
JSOPtION_RELIMIT has been removed. Bug 803358.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.