From 4b29736ba22f385582cf985ca6ede792435b3263 Mon Sep 17 00:00:00 2001 From: Yotam Mann Date: Sat, 5 Sep 2015 19:17:00 -0400 Subject: [PATCH] don't do recurse defaultArg if it's an array --- Tone/core/Tone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tone/core/Tone.js b/Tone/core/Tone.js index 46705a74..78fe91e1 100644 --- a/Tone/core/Tone.js +++ b/Tone/core/Tone.js @@ -502,7 +502,10 @@ define(function(){ * @return {*} */ Tone.prototype.defaultArg = function(given, fallback){ - if (typeof given === "object" && typeof fallback === "object"){ + if (typeof given === "object" && + typeof fallback === "object" && + !Array.isArray(given) && + !Array.isArray(fallback)){ var ret = {}; //make a deep copy of the given object for (var givenProp in given) {