mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
4ef5e33697
Closure Compiler will soon start typechecking well-known symbol properties, such as Symbol.iterator - see https://github.com/google/closure-compiler/issues/1737. This will cause some type errors in existing code that implements `Iterable` (for context, I ran into these errors in google's internal repo) that is missing a Symbol.iterator override or `@override` annotation
35 lines
730 B
JavaScript
35 lines
730 B
JavaScript
/*! @license
|
|
* Shaka Player
|
|
* Copyright 2016 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @fileoverview Externs for DOMStringList to override those provided by the
|
|
* Closure Compiler.
|
|
*
|
|
* TODO: contribute fixes to the Closure Compiler externs
|
|
*
|
|
* @externs
|
|
*/
|
|
|
|
|
|
/**
|
|
* This is an Iterable, but Closure's built-in extern doesn't seem to declare it
|
|
* as such in this version of the compiler (20200406).
|
|
*
|
|
* Here we override that definition.
|
|
*
|
|
* @implements {IArrayLike<string>}
|
|
* @implements {Iterable<string>}
|
|
* @constructor
|
|
* @suppress {duplicate}
|
|
*/
|
|
var DOMStringList = function() {};
|
|
|
|
/**
|
|
* @override
|
|
* @return {!Iterator<string>}
|
|
*/
|
|
DOMStringList.prototype[Symbol.iterator] = function() {};
|