mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 826008: Fix type tests for constraints objects r=smaug
This commit is contained in:
parent
2bda0b1509
commit
cda946d552
@ -599,7 +599,7 @@ PeerConnectionImpl::ConvertConstraints(
|
||||
|
||||
// Mandatory constraints.
|
||||
if (JS_GetProperty(aCx, &constraints, "mandatory", &mandatory)) {
|
||||
if (JSVAL_IS_PRIMITIVE(mandatory) && mandatory.isObject() && !JSVAL_IS_NULL(mandatory)) {
|
||||
if (mandatory.isObject()) {
|
||||
JSObject* opts = JSVAL_TO_OBJECT(mandatory);
|
||||
JS::AutoIdArray mandatoryOpts(aCx, JS_Enumerate(aCx, opts));
|
||||
|
||||
@ -622,7 +622,7 @@ PeerConnectionImpl::ConvertConstraints(
|
||||
|
||||
// Optional constraints.
|
||||
if (JS_GetProperty(aCx, &constraints, "optional", &optional)) {
|
||||
if (JSVAL_IS_PRIMITIVE(optional) && optional.isObject() && !JSVAL_IS_NULL(optional)) {
|
||||
if (optional.isObject()) {
|
||||
JSObject* opts = JSVAL_TO_OBJECT(optional);
|
||||
if (JS_IsArrayObject(aCx, opts)) {
|
||||
uint32_t length;
|
||||
@ -632,7 +632,7 @@ PeerConnectionImpl::ConvertConstraints(
|
||||
for (i = 0; i < length; i++) {
|
||||
jsval val;
|
||||
JS_GetElement(aCx, opts, i, &val);
|
||||
if (JSVAL_IS_PRIMITIVE(val)) {
|
||||
if (val.isObject()) {
|
||||
// Extract name & value and store.
|
||||
// FIXME: MediaConstraints does not support optional constraints?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user