Skip to content

Commit

Permalink
fix: add strictMissingProperties suppressions to unblock strict missi…
Browse files Browse the repository at this point in the history
…ng properties on union types. (shaka-project#4371)

JSCompiler's strict missing properties on union types change improves the missing properties check to report properties that do not exist on all members of union types (excluding null or undefined and after boxing primitives).
  • Loading branch information
rahul-kamat committed Jul 22, 2022
1 parent 3c92f05 commit b361948
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/media/streaming_engine.js
Expand Up @@ -1790,6 +1790,7 @@ shaka.media.StreamingEngine = class {
*
* @return {!Promise.<BufferSource>}
* @private
* @suppress {strictMissingProperties}
*/
async fetch_(mediaState, reference, streamDataCallback) {
const requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;
Expand Down
3 changes: 3 additions & 0 deletions lib/util/buffer_utils.js
Expand Up @@ -20,6 +20,7 @@ shaka.util.BufferUtils = class {
* @param {?BufferSource} arr2
* @return {boolean}
* @export
* @suppress {strictMissingProperties}
*/
static equal(arr1, arr2) {
const BufferUtils = shaka.util.BufferUtils;
Expand Down Expand Up @@ -135,8 +136,10 @@ shaka.util.BufferUtils = class {
static view_(data, offset, length, Type) {
const buffer = shaka.util.BufferUtils.unsafeGetArrayBuffer_(data);
// Absolute end of the |data| view within |buffer|.
/** @suppress {strictMissingProperties} */
const dataEnd = (data.byteOffset || 0) + data.byteLength;
// Absolute start of the result within |buffer|.
/** @suppress {strictMissingProperties} */
const rawStart = (data.byteOffset || 0) + offset;
const start = Math.max(0, Math.min(rawStart, dataEnd));
// Absolute end of the result within |buffer|.
Expand Down
1 change: 1 addition & 0 deletions lib/util/object_utils.js
Expand Up @@ -22,6 +22,7 @@ shaka.util.ObjectUtils = class {
const seenObjects = new Set();
// This recursively clones the value |val|, using the captured variable
// |seenObjects| to track the objects we have already cloned.
/** @suppress {strictMissingProperties} */
const clone = (val) => {
switch (typeof val) {
case 'undefined':
Expand Down

0 comments on commit b361948

Please sign in to comment.