Fixed check for arguments at xhr.send()

This commit is contained in:
Carsten Sandtner 2013-05-15 13:57:25 +02:00
parent 89fc8168e5
commit 4cb3001fc6
1 changed files with 9 additions and 9 deletions

View File

@ -616,19 +616,19 @@ JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, send)
{ {
JSString *str; JSString *str;
char *data;
// Clean up header map. New request, new headers! // Clean up header map. New request, new headers!
http_header.clear(); http_header.clear();
if (argc == 2) {
if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &str)) { if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &str)) {
return JS_FALSE; return JS_FALSE;
}; };
data = JS_EncodeString(cx, str);
if (meth.compare("post") == 0 || meth.compare("POST") == 0) { }
char *data = JS_EncodeString(cx, str);
cc_request->setRequestData(data, strlen(data));
if (meth.compare("post") == 0 || meth.compare("POST") == 0) {
cc_request->setRequestData(data, strlen(data));
} }
_setHttpRequestHeader(); _setHttpRequestHeader();