Closed
Bug 697271
Opened 13 years ago
Closed 13 years ago
XMLHttpRequest.send() should use JS coercion rules
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
WORKSFORME
mozilla14
People
(Reporter: sicking, Unassigned)
References
(Blocks 1 open bug)
Details
Per the spec, if XHR.send is called with a type of argument it does not recognize (Blob, ArrayBuffer, Document, FormData) it should use normal JS coercion rules to convert any other value to a string. Obviously we should additionally support the set of additional types that we support internally (nsISupportsString?, nsIInputStream).
That means that for the following calls, we should get the following results:
xhr.send(2) -> "2"
xhr.send(false) -> "false"
xhr.send(new XMLHttpRequest) -> "[Object XMLHttpRequest]"
xhr.send({ toString: function() { return "foo" } }) -> "foo"
This is what the "[AllowAny]" extended parameter on the .send(DOMString) signature means.
Comment 1•13 years ago
|
||
Perhaps we should just fix XPCVariant::GetAsWStringWithSize to do the right thing.
Or Send could take jsval as parameter.
Reporter | ||
Comment 2•13 years ago
|
||
Ccing mrbkap to see if changing GetWStringWithSize is feasible.
Changing to jsval would work, though we have lots of C++ callers that we need to keep in mind somehow.
I also think you can get the jsval out of the nsIVariant
Updated•13 years ago
|
Component: DOM → DOM: Mozilla Extensions
OS: Mac OS X → All
Hardware: x86 → ARM
Updated•13 years ago
|
Hardware: ARM → All
Updated•13 years ago
|
Depends on: ParisBindings
This is WFM with the Paris bindings, right?
Comment 4•13 years ago
|
||
Indeed.
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
Target Milestone: --- → mozilla14
Assignee | ||
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•