Clean up EBML size constants

Instead of using an array of Uint8Arrays, which could trigger a
load-time failure on very old browsers, store an array of number
arrays.  This is equivalent for the purpose of comparison, and it
cannot fail at load-time.

This cleanup seems to fix minor test flake in the EBML parser tests
that was observed with upgraded node modules.

Issue #1694

Change-Id: I87b2307bceddb3a21dfc81d4fe9828afd9508617
This commit is contained in:
Joey Parrish
2019-05-15 12:30:40 -07:00
parent 3adde6a28d
commit ea4d941f39
2 changed files with 22 additions and 22 deletions
+5 -2
View File
@@ -109,8 +109,11 @@ shaka.util.Uint8ArrayUtils.toHex = function(arr) {
/**
* Compare two Uint8Arrays for equality.
* @param {Uint8Array} arr1
* @param {Uint8Array} arr2
* For convenience, this also accepts Arrays, so that one can trivially compare
* a Uint8Array to an Array of numbers.
*
* @param {(Uint8Array|Array.<number>)} arr1
* @param {(Uint8Array|Array.<number>)} arr2
* @return {boolean}
* @export
*/