Skip to content

Commit

Permalink
Fix bad assertion
Browse files Browse the repository at this point in the history
In "Fix missing or bad type info" (Change-Id
I7f2d070e3da32fe9ff5f444315649f3cbdb5a4a5), I added a bad assertion
that failed at runtime.  The placement was wrong and the type I was
asserting was too strict.  This fixes both mistakes.

Issue shaka-project#2528

Change-Id: I297f8c846bf13775a4a59fd43349c96cfcaf3729
  • Loading branch information
joeyparrish committed Apr 29, 2020
1 parent b6fb13c commit ccb547c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1317,16 +1317,16 @@ shakaDemo.Main = class {

const navButtons = document.getElementById('nav-button-container');
for (const button of navButtons.childNodes) {
goog.asserts.assert(
button instanceof HTMLButtonElement, 'Wrong element type!');
if (button.nodeType == Node.ELEMENT_NODE &&
button.classList.contains('mdl-button--accent')) {
params.push('panel=' + button.getAttribute('tab-identifier'));
const hashValues = button.getAttribute('tab-hash');
if (hashValues) {
params.push('panelData=' + hashValues);
if (button.nodeType == Node.ELEMENT_NODE) {
goog.asserts.assert( button instanceof HTMLElement, 'Wrong node type!');
if (button.classList.contains('mdl-button--accent')) {
params.push('panel=' + button.getAttribute('tab-identifier'));
const hashValues = button.getAttribute('tab-hash');
if (hashValues) {
params.push('panelData=' + hashValues);
}
break;
}
break;
}
}

Expand Down

0 comments on commit ccb547c

Please sign in to comment.