Commit Graph

10 Commits

Author SHA1 Message Date
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish 4dc2c65578 Add type assertions for Errors
In many places, we check error codes on shaka.util.Error.  But the
compiler doesn't know that what is caught in "catch" is that type, so
we add type assertions.

In some cases, we know that other types may also be thrown, so there
are also some runtime checks.  Some of these had to be refactored to
allow the compiler to correctly infer types.

Change-Id: I053bd7e96213c689aae3889315052dd402124690
2020-04-29 10:11:21 -07:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble f6d0f15fa6 Refactor handling of destroy().
This changes several classes to use the Destroyer class to handle
destroy().  This also changes the behavior to not ignore destruction
and instead throw a new error.  This is more clear for callers and
ensures we propagate errors.

Change-Id: I756c085639558509c22e5c43d69ddf4acd28d46f
2019-06-19 20:39:20 +00:00
Sandra Lokshina 0e7c366e9d Convert more utils to es6.
Issue #1157.

Change-Id: I49092237b7fe7f98a22087b0ecf41f65005dbc61
2019-05-28 22:17:48 +00:00
Aaron Vaage 2c33d519ff Remove Destroyer.with
Replace the last use of |Destroyer.with| in the library. The final use
was in Storage, and this CL replaces that last usage with try-finally.

Close #1516

Change-Id: Ic0946a564b66a48b567ffd6d1cfd4b9ec76fc039
2019-03-08 01:28:55 +00:00
Joey Parrish bb646befca Fix issues found by newer compilers and linters
Some of these issues were found by the Closure Compiler linter,
which we are not currently using here.  I will try to re-enable it
in a follow-up change.

Change-Id: Ie6e75f2b5a1e0f888c3dfbc78ed9cf254d2738bb
2018-08-09 12:22:34 -07:00
Aaron Vaage 71a404168f Fix Style Issue With Destroyer
There was an extra line that was not detected before. This change
removes the line that now causes linting failures.

Change-Id: Idb0d5dfacfc0aeabeef5b22face1e5606a28175a
2018-07-09 15:36:18 -07:00
Aaron Vaage ab7dcccba0 Use Destroyer to handle more IDestroyable Interactions
To make it easier to ensure that destroy logic for a class is only called
once, Destroyer can be used to manage that logic for any IDestroyable
implementation.

Change-Id: If69b815882a68e31191230adb08f5da8f51fc3d2
2018-07-09 22:25:38 +00:00
Aaron Vaage 546942fc3a Created Destroyer Class To Handler IDestroyable
Created the Destroyer class to handle working with IDestroyable so that
IDestroyable can be a simple interface (no more static methods).

Change-Id: I5afd915b895a4c60d758475a2b879bf0eb0096c9
2018-07-09 22:19:19 +00:00