Closed Bug 524763 Opened 15 years ago Closed 15 years ago

Regexp/string confusion in generateTextForTextNode in about:support

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.7a1
Tracking Status
status1.9.2 --- beta4-fixed

People

(Reporter: jruderman, Assigned: cbartley)

Details

Attachments

(1 file)

let text = node.textContent.trim().replace("\n[ \t]*", "\n" + indent);

Shouldn't that be a regexp rather than a literal string?
Attachment #409455 - Flags: review?(johnath)
Attachment #409455 - Flags: review?(johnath) → review+
Keywords: checkin-needed
Comment on attachment 409455 [details] [diff] [review]
string -> regex literal, v1

>+  let text = node.textContent.trim().replace(/\n/g, "\n" + indent);

You don't need a regexp for this:
.replace("\n", "\n" + indent, "g");
(In reply to comment #2)
> (From update of attachment 409455 [details] [diff] [review])
> >+  let text = node.textContent.trim().replace(/\n/g, "\n" + indent);
> 
> You don't need a regexp for this:
> .replace("\n", "\n" + indent, "g");

made it so:

http://hg.mozilla.org/mozilla-central/rev/6658101fa6c7
Assignee: nobody → cbartley
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
Attachment #409455 - Flags: approval1.9.2?
Attachment #409455 - Flags: approval1.9.2? → approval1.9.2+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: