Bug 813885 - RTCIceCandidate constructor arguments don't match spec. r=jesup

This commit is contained in:
Paul Adenot 2012-11-21 15:52:43 +01:00
Родитель 18de49f4ce
Коммит f7141fa129
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -114,14 +114,18 @@ IceCandidate.prototype = {
Ci.nsIDOMRTCIceCandidate, Ci.nsIDOMGlobalObjectConstructor
]),
constructor: function(win, cand, mid, mline) {
constructor: function(win, candidateInitDict) {
if (this._win) {
throw new Error("Constructor already called");
}
this._win = win;
this.candidate = cand;
this.sdpMid = mid;
this.sdpMLineIndex = mline;
if (candidateInitDict !== undefined) {
this.candidate = candidateInitDict.candidate || null;
this.sdpMid = candidateInitDict.sdbMid || null;
this.sdpMLineIndex = candidateInitDict.sdpMLineIndex || null;
} else {
this.candidate = this.sdpMid = this.sdpMLineIndex = null;
}
}
};