Closed Bug 59665 Opened 25 years ago Closed 25 years ago

select list's selectedIndex setter does not attempt to convert strings to numbers

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: rginda, Assigned: jst)

References

()

Details

(Keywords: dom0, Whiteboard: [XPCDOM])

Attachments

(1 file)

ETrade stores your last "start in" select box value in a cookie each time you change it. When revisiting the site, it reads this cookie and tries to reset it to whatever you had last. The line where the select box state is restored is: document.forms[0].goWhere.selectedIndex = selectGoWhere; Where |selectGoWhere| is split out of the cookie, and never converted from a string to a number. The DOM glue code generated by JSStubGen doesn't attempt to convert strings to numbers, and so this line of JS fails with an NS_ERROR_DOM_NOT_NUMBER_ERR error. The attached patch should fix this by allowing JS to do attempt a conversion to an int32 if the value is a string. If this conversion should fail, NS_ERROR_DOM_NOT_NUMBER_ERR will then be reported. (The same way a JSVAL_IS_NUMBER would fail if it were outside the range of an int32, btw.)
This will be fixed once the DOM uses XPConnect since XPConnect already deals with this. We're working on this right now. Pushing this to Future to keep it off my bug radar.
Status: NEW → ASSIGNED
Whiteboard: [XPCDOM]
Hardware: PC → All
Target Milestone: --- → Future
Keywords: dom0
Fixed with the xpcdom landing.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: