-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't test against http://example.com/english.vtt #2720
Conversation
This is causing failures in IE8. Also, don't include 'src' in json output if it doesn't exist.
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 471702e (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 1250e75 (Please note that this is a fully automated comment.) |
}; | ||
if (track.src) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of specifically handling src
here, would it make sense to generally exclude any falsy property?
Object.keys(ret).forEach(k => {
if (!ret[k]) {
delete ret[k];
}
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was debating that. We do know exactly what keys we want, so, we could just loop through those keys and copy them over only if they have values. We might need to do a null check on the other side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, add-if-present might be more efficient (in terms of reading the code if not performance).
let ret = {};
['kind', 'label', 'language', 'id', 'inBand...', 'mode', 'src'].forEach(k => {
if (track[k]) {
ret[k] = track[k];
}
});
if (track.cues) {
// special map handling for cues
}
return ret;
Closing in favor of this rebased version: #2744 |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 183d56c (Please note that this is a fully automated comment.) |
This is causing failures in IE8.
Also, don't include 'src' in json output if it doesn't exist.