Bug 823512: Part 4: Workaround for lack of serializer support (bug 863402). r=bz

This commit is contained in:
Jan-Ivar Bruaroey 2013-05-15 01:07:49 -04:00
parent 7606ce231a
commit e810b729f7
3 changed files with 10 additions and 2 deletions

View File

@ -320,7 +320,8 @@ class IDLUnresolvedIdentifier(IDLObject):
[location])
if name[0] == '_' and not allowDoubleUnderscore:
name = name[1:]
if name in ["constructor", "iterator", "toString", "toJSON"] and not allowForbidden:
# TODO: Bug 872377, Restore "toJSON" to below list.
if name in ["constructor", "iterator", "toString"] and not allowForbidden:
raise WebIDLError("Cannot use reserved identifier '%s'" % (name),
[location])

View File

@ -153,6 +153,12 @@ RTCSessionDescription.prototype = {
__init: function(dict) {
this.type = dict.type;
this.sdp = dict.sdp;
},
// Bug 863402 serializer support workaround
toJSON: function() {
return { type: this.type, sdp: this.sdp,
__exposedProps__: { type: "rw", sdp: "rw" } };
}
};

View File

@ -25,6 +25,7 @@ interface mozRTCSessionDescription {
attribute RTCSdpType? type;
attribute DOMString? sdp;
// Bug 863402 serializer support
// Bug 863402 serializer support workaround
//serializer = {attribute};
object toJSON();
};