Closed
Bug 284574
Opened 20 years ago
Closed 20 years ago
Empty strings from C++ XPCOM are converted to null, not to JSString object
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
INVALID
People
(Reporter: egorenkov, Assigned: dbradley)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1 XPConnect, namely code in js/src/xpconnect/src/xpcconvert.cpp, should convert empty strings (with zero length or null pointers) that it gets from C++ XPCOM objects to JSString objects. Now it converts them to null, so in JavaScript I get 'null' instead of empty strings. Reproducible: Always Steps to Reproduce:
Comment 1•20 years ago
|
||
null pointers are null pointers. why should they become empty strings instead of null? (I thought zero-length strings already are converted to "" in JS, are they not? http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/src/xpcconvert.cpp#351 looks like they are)
OS: Windows XP → All
Hardware: PC → All
| Reporter | ||
Comment 2•20 years ago
|
||
Agree about null pointers. I was much more concerned about zero-length strings and they work perfectly – it was my bug. I’m ashamed.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
| Assignee | ||
Comment 3•20 years ago
|
||
No need to be ashamed, you realized your mistake and corrected it.
You need to log in
before you can comment on or make changes to this bug.
Description
•