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

Handle isArray for es6 iterator #5679

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions js/highcharts.src.js
Expand Up @@ -481,7 +481,7 @@
value = original[key];

// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&
if (value && typeof value === 'object' && !isArray(value) &&
key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);

Expand Down Expand Up @@ -531,7 +531,8 @@
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
var str = Object.prototype.toString.call(obj);
return str === '[object Array]' || str === '[object Array Iterator]';
}

/**
Expand Down
5 changes: 3 additions & 2 deletions js/highstock.src.js
Expand Up @@ -481,7 +481,7 @@
value = original[key];

// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&
if (value && typeof value === 'object' && !isArray(value) &&
key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);

Expand Down Expand Up @@ -531,7 +531,8 @@
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
var str = Object.prototype.toString.call(obj);
return str === '[object Array]' || str === '[object Array Iterator]';
}

/**
Expand Down
3 changes: 2 additions & 1 deletion js/modules/annotations.src.js
Expand Up @@ -71,7 +71,8 @@
}

function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
var str = Object.prototype.toString.call(obj);
return str === '[object Array]' || str === '[object Array Iterator]';
}

function defined(obj) {
Expand Down
5 changes: 3 additions & 2 deletions lib/highmaps.src.js
Expand Up @@ -479,7 +479,7 @@
value = original[key];

// Copy the contents of objects, but not arrays or DOM nodes
if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]' &&
if (value && typeof value === 'object' && !isArray(value) &&
key !== 'renderTo' && typeof value.nodeType !== 'number') {
copy[key] = doCopy(copy[key] || {}, value);

Expand Down Expand Up @@ -529,7 +529,8 @@
* @param {Object} obj
*/
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
var str = Object.prototype.toString.call(obj);
return str === '[object Array]' || str === '[object Array Iterator]';
}

/**
Expand Down