File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -389,8 +389,6 @@ export class PeerConnectionClass implements PeerConnection<signals.Message> {
389389 if ( state === 'have-local-offer' ) {
390390 return this . pc_ . getLocalDescription ( ) . then (
391391 ( localOffer :freedom_RTCPeerConnection . RTCSessionDescription ) => {
392- // TODO: either specify a functional call requirement that the sdp
393- // fields are valid JSON, so add a try-catch.
394392 if ( djb2 . stringHash ( JSON . stringify ( remoteOffer . sdp ) ) <
395393 djb2 . stringHash ( JSON . stringify ( localOffer . sdp ) ) ) {
396394 // TODO: implement reset and use their offer.
@@ -444,14 +442,8 @@ export class PeerConnectionClass implements PeerConnection<signals.Message> {
444442 this . fromPeerCandidateQueue . setHandler ( this . pc_ . addIceCandidate ) ;
445443 } )
446444 . catch ( ( e ) => {
447- var descriptionString :string
448- try {
449- descriptionString = JSON . stringify ( description )
450- } catch ( e ) {
451- descriptionString = "[unstringifiable object]"
452- }
453- this . closeWithError_ ( 'Failed to set remote description: ' + descriptionString
454- + '; Error: ' + e . toString ( ) ) ;
445+ this . closeWithError_ ( 'Failed to set remote description: ' +
446+ JSON . stringify ( description ) + '; Error: ' + e . toString ( ) ) ;
455447 } ) ;
456448 }
457449
You can’t perform that action at this time.
0 commit comments