W3C home > Mailing lists > Public > public-webrtc@w3.org > March 2015

Re: PSA: JSON.stringify has changed behavior wrt DOM objects in Chrome

From: Tim Panton new <thp@westhawk.co.uk>
Date: Wed, 18 Mar 2015 10:20:10 +0000
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-Id: <63E225AA-F26D-432F-870E-7154554D88BF@westhawk.co.uk>
To: Harald Alvestrand <harald@alvestrand.no>

> On 18 Mar 2015, at 09:46, Harald Alvestrand <harald@alvestrand.no> wrote:
> 
> There's been a change in the behavior of recent (canary) versions of Chrome, described here:
> 
> https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/H0MGw0jkdn4/discussion
> 
> The change means that a lot of DOM attributes are now no longer picked up by JSON.stringify; I'm not quite sure whether this was intentional or not.

Would this be why I can no longer call JSON.stringify() directly on a RTCSessionDescription ? 
- I’ve had to resort to :

createOffer(function(offer){
	offer_sdp = {
  		sdp: offer.sdp.sdp
  		type: offer.sdp.type
	};
	send_offer(Json.stringify(offer_sdp));
},fail);

where previously I had :

createOffer(function(offer){
	send_offer(Json.stringify(offer.sdp));
},fail);

If so, this could break a _lot_ of running code.


> 
> This affects a couple of examples in our spec that use JSON.stringify.
> I've filed #204 to deal with the issue.
> 
> Harald
> 
> 
Received on Wednesday, 18 March 2015 10:20:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:04 UTC