Skip to content

Commit

Permalink
[].slice instead of Array.prototype.slice
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrunel committed Jan 29, 2019
1 parent 1d4b41a commit 445cf19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/core.controller.js
Expand Up @@ -41,7 +41,7 @@ defaults._set('global', {
* returns a deep copy of the result, thus doesn't alter inputs.
*/
function mergeScaleConfig(/* config objects ... */) {
return helpers.merge({}, Array.prototype.slice.call(arguments), {
return helpers.merge({}, [].slice.call(arguments), {
merger: function(key, target, source, options) {
if (key === 'xAxes' || key === 'yAxes') {
var slen = source[key].length;
Expand All @@ -53,7 +53,7 @@ function mergeScaleConfig(/* config objects ... */) {

for (i = 0; i < slen; ++i) {
scale = source[key][i];
type = helpers.valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');
type = valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');

if (i >= target[key].length) {
target[key].push({});
Expand Down Expand Up @@ -81,7 +81,7 @@ function mergeScaleConfig(/* config objects ... */) {
* a deep copy of the result, thus doesn't alter inputs.
*/
function mergeConfig(/* config objects ... */) {
return helpers.merge({}, Array.prototype.slice.call(arguments), {
return helpers.merge({}, [].slice.call(arguments), {
merger: function(key, target, source, options) {
var tval = target[key] || {};
var sval = source[key];
Expand Down

0 comments on commit 445cf19

Please sign in to comment.