Closed Bug 498797 Opened 15 years ago Closed 15 years ago

type conversion to string incorrectly handles 'null' returned by user-defined toString

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11
Build Identifier: 

This is a bug in two functions: ArgToRootedString and js_ValueToString.
To exercise the bug in js_ValueToString:

print({toString:function(){return null}})
// should print 'null'

To exercise the path through ArgToRootedString:

print(escape({toString:function(){return null}}))
// should print 'null'

This fix is part of the patch in bug 200505

Reproducible: Always
Depends on: 200505
Flags: in-testsuite?
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.