-
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
fix: make mergeOptions behave the same across browsers (5.x) #4090
Conversation
`Object.keys()` will error on IE11 instead of default to an empty array
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.
One small request, otherwise LGTM.
src/js/utils/obj.js
Outdated
@@ -30,6 +30,10 @@ | |||
*/ | |||
const toString = Object.prototype.toString; | |||
|
|||
const keys = function(object) { |
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.
Can we get a JSDoc block for this function, with @private
?
src/js/utils/obj.js
Outdated
/* | ||
* Gives keys of an object | ||
* | ||
* @param {Object} object |
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.
The doc comments should probably look something like this to follow a similar format for the project. I more descriptive language as well.
/**
* Get the keys of an Object
*
* @param {Object}
* The Object to get the keys from
*
* @return {string[]}
* An array of the keys from the object. Returns an empty array if the
* object passed in was invalid or had no keys.
*
* @private
*/
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.
Thank you, shamelessly copy/pasted
164abe8
to
9c6418d
Compare
Description
Object.keys() will error on IE11 instead of default to an empty array, this will make sure that videojs.mergeOptions() has the same behavior across browsers.
Specific Changes proposed
Made a keys() function that defaults to [] when given an non-object.
Requirements Checklist