Closed
Bug 692412
Opened 13 years ago
Closed 13 years ago
Firefox 10.0a1 Nightly not recognizing the replace() javascript method (typeof document.getSelection() == object)
Categories
(Core :: General, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: srazzano, Unassigned)
References
Details
(Keywords: regression, testcase)
Attachments
(1 file)
253 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 Build ID: 20110928134238 Steps to reproduce: String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); } Actual results: Nothing Expected results: Trim leading and trailing spaces.
Reporter | ||
Updated•13 years ago
|
Hardware: x86_64 → x86
Reporter | ||
Updated•13 years ago
|
Hardware: x86 → x86_64
Mozilla/5.0 (Windows NT 5.1; rv:10.0a1) Gecko/20111006 Firefox/10.0a1 This works for me: " TEST ".replace(/^\s+|\s+$/g, "")
Reporter | ||
Comment 2•13 years ago
|
||
" TEST ".replace(/^\s+|\s+$/g, "") works here as well but this does not: window.addEventListener('mouseup', getMe, false); function getMe() { var getText = document.getSelection(); alert(getText); alert(getText.replace(/^\s+|\s+$/g, "")); }
Keywords: regression,
testcase
Product: Firefox → Core
QA Contact: general → general
Summary: Firefox 10.0a1 Nightly not recognizing the replace() javascript method → Firefox 10.0a1 Nightly not recognizing the replace() javascript method (typeof document.getSelection() == object)
document.getSelection() returns "object" in Nightly 10 instead of "string"
This is intended, see bug 636512
Workaround: var getText = document.getSelection().toString(); or something
Reporter | ||
Comment 6•13 years ago
|
||
Yes, toString() is the ticket. Thank you.
You need to log in
before you can comment on or make changes to this bug.
Description
•