Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ivar committed Dec 16, 2023
1 parent 8ebeb3a commit 9f65fa6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/js/chrome/chrome_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,18 @@ export function shimRTCRtpScriptTransform(window) {
this._transfer = transfer;
}
};
const property = {
const prop = {
get() {
return this._transform || null;
},
set(transform) {
if (transform && !(transform instanceof window.RTCRtpScriptTransform)) {
throw new TypeError("expected window.RTCRtpScriptTransform");
throw new TypeError('expected window.RTCRtpScriptTransform');
}
this._transform = transform || null;
if (!transform) return;
if (!transform) {
return;
}
const {readable, writable} = this.createEncodedStreams();
transform._worker.postMessage({
rtctransform: {
Expand All @@ -730,7 +732,7 @@ export function shimRTCRtpScriptTransform(window) {
}, [readable, writable, ...(transform._transfer || [])]);
}
};
Object.defineProperty(window.RTCRtpSender.prototype, 'transform', property);
Object.defineProperty(window.RTCRtpReceiver.prototype, 'transform', property);
Object.defineProperty(window.RTCRtpSender.prototype, 'transform', prop);
Object.defineProperty(window.RTCRtpReceiver.prototype, 'transform', prop);
}
}

0 comments on commit 9f65fa6

Please sign in to comment.