Skip to content

Commit

Permalink
Suppress a bogus compiler error in StreamingEngine
Browse files Browse the repository at this point in the history
This adds an annotation to suppress a bogus compiler error in
StreamingEngine.  In this method, we set updateTimer to null, then
await some async operation, then check to see if it's still null.  The
latest Closure Compiler thinks this is a useless check, but we know
better.  The updateTimer could have been created while the async
operation was in progress.

Issue #2528

Change-Id: I9a28b7dac1d7cb8bcfd836847507454030af52c6
  • Loading branch information
joeyparrish committed Apr 28, 2020
1 parent a955d9f commit 2d3c47f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ shaka.media.StreamingEngine = class {
* Called when |mediaState|'s update timer has expired.
*
* @param {!shaka.media.StreamingEngine.MediaState_} mediaState
* @suppress {suspiciousCode} The compiler assumes that updateTimer can't
* change during the await, and so complains about the null check.
* @private
*/
async onUpdate_(mediaState) {
Expand Down

0 comments on commit 2d3c47f

Please sign in to comment.