don't convert undefined to null in rpc requests

This commit is contained in:
Ari Lazier 2015-10-27 12:13:19 -07:00
parent 18d65471be
commit ec87281cc1
2 changed files with 9 additions and 1 deletions

View File

@ -90,6 +90,10 @@ function serialize(realmId, value) {
return {type: objectTypes.FUNCTION};
}
if (typeof value === 'undefined') {
return {type: 'undefined'};
}
if (!value || typeof value != 'object') {
return {value: value};
}

View File

@ -315,6 +315,10 @@ JSValueRef RPCServer::deserialize_json_value(const json dict)
}
return date;
}
else if (type_string == "undefined") {
return JSValueMakeUndefined(m_context);
}
assert(0);
}
if (value.is_null()) {
@ -353,5 +357,5 @@ JSValueRef RPCServer::deserialize_json_value(const json dict)
return js_object;
}
return JSValueMakeUndefined(m_context);
assert(0);
}