Skip to content
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

bug fix #2028 #2029

Merged

Conversation

nicosang
Copy link
Contributor

in some browsers, Number.isInteger function is not defined.
This PR fix the issue #2028

@@ -41,6 +41,12 @@ import ObjectUtils from '../../streaming/utils/ObjectUtils';
import URLUtils from '../../streaming/utils/URLUtils';
import FactoryMaker from '../../core/FactoryMaker';

Number.isInteger = Number.isInteger || function (value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to see a local function within DashManifestModel to avoid modifying Number within dash.js.

function DashManifestModel(config) {
    const isInteger = Number.isInteger || function (value) { ...
...
    if (realAdaptations && isInteger(index)) { ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bbcrddave ,

if the function Number.isInteger is undefined in a specific browser, define a polyfill function could be useful in a another part of javascript code. In this case, it could be cleaner to put this polyfill function in a specific file (in utils folder).
On another side, this function is currently only use in DashManifestModel. So, your option could indeed be selected.
In any case, if Number.IsInteger is already defined, we don't override it.

Nicolas

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved this polyfill function in the DashManifestModel as expected by mostly people. ;-)

@davemevans davemevans self-requested a review June 23, 2017 12:43
@dsparacio dsparacio merged commit 9a5a35d into Dash-Industry-Forum:development Jul 7, 2017
@nicosang nicosang deleted the bug_fix_2028 branch July 10, 2017 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants