1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-27 11:22:06 +02:00

refactor: do not allow adding children with options passed in as a boolean (#3872)

This has been deprecated throughout 5.0 and being removed. To include a child, you must use an object  or false to exclude it. true will no longer be supported.

BREAKING CHANGE: remove ability to add children with options as a boolean.
This commit is contained in:
Brandon Casey 2017-01-18 00:31:34 -05:00 committed by Gary Katsevman
parent e12bedbb45
commit b07143d276

View File

@ -341,21 +341,6 @@ class Component {
if (typeof child === 'string') {
componentName = toTitleCase(child);
// Options can also be specified as a boolean,
// so convert to an empty object if false.
if (!options) {
options = {};
}
// Same as above, but true is deprecated so show a warning.
if (options === true) {
log.warn('Initializing a child component with `true` is deprecated.' +
'Children should be defined in an array when possible, ' +
'but if necessary use an object instead of `true`.'
);
options = {};
}
const componentClassName = options.componentClass || componentName;
// Set name through options