Bug 1528323 - Part 1.1: Fix bug in _queueWithClosedCheck where |this| did not refer to the PeerConnection. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D21015

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Byron Campen [:bwc] 2019-02-27 16:05:47 +00:00
parent 301e6c847e
commit de0958d2f0

View File

@ -586,10 +586,11 @@ class RTCPeerConnection {
// This implements the fairly common "Queue a task" logic
async _queueTaskWithClosedCheck(func) {
const pc = this;
return new this._win.Promise((resolve, reject) => {
Services.tm.dispatchToMainThread({ run() {
try {
if (!this._closed) {
if (!pc._closed) {
func();
resolve();
}