Incorrectly escaped regexp in browser/app/profile/firefox.js - warning preserving unexpected JS escape sequence: file modules/libpref/prefread.cpp, line 393

RESOLVED FIXED in Firefox 40

Status

()

Firefox
Tours
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Nickolay_Ponomarev, Assigned: jaws)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 40
Points:
1
Dependency tree / graph
Bug Flags:
firefox-backlog +
qe-verify -

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
In browser/app/profile/firefox.js:255 <http://hg.mozilla.org/mozilla-central/annotate/a32e3b93c8d8/browser/app/profile/firefox.js#l254>

> pref("browser.uitour.readerViewTrigger", "^https:\/\/www\.mozilla\.org\/[^\/]+\/firefox\/reading\/start");

(added in bug 1134501) triggers 9 warnings on a startup in a debug build:

WARNING: preserving unexpected JS escape sequence: file modules/libpref/prefread.cpp, line 393

Backslashes are supposed to be escaped in pref files. I'm guessing "https:\\/\\/" and so on, but I didn't test.

(a similar case was recently fixed in bug 1146097)
Created attachment 8594547 [details] [diff] [review]
Patch
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Attachment #8594547 - Flags: review?(jruderman)
Iteration: --- → 40.2 - 27 Apr
Points: --- → 1
Flags: qe-verify-
Flags: firefox-backlog+
OS: Mac OS X → All
Hardware: x86 → All

Comment 2

3 years ago
Comment on attachment 8594547 [details] [diff] [review]
Patch

Review of attachment 8594547 [details] [diff] [review]:
-----------------------------------------------------------------

Looks right to me. I think it would also work with / in place of \\/, since you call the RegExp constructor rather than eval'ing a literal delimited by slashes.
Attachment #8594547 - Flags: review?(jruderman) → review+
Thanks for the r+. I'll leave it as-is for now wrt the backslashes being necessary.
Keywords: checkin-needed

Updated

3 years ago
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/6a29dd1152df
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: affected → fixed
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 40
You need to log in before you can comment on or make changes to this bug.