mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
don't do recurse defaultArg if it's an array
This commit is contained in:
parent
7c0318cbdf
commit
4b29736ba2
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue