Skip to content

Commit

Permalink
Ensure preserveToString doesn't error out if provided an invalid `s…
Browse files Browse the repository at this point in the history
…ource`.
  • Loading branch information
ljharb committed Oct 23, 2015
1 parent 30f4bde commit caa4463
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@
}
},
preserveToString: function (target, source) {
defineProperty(target, 'toString', source.toString.bind(source), true);
if (source && ES.IsCallable(source.toString)) {
defineProperty(target, 'toString', source.toString.bind(source), true);
}
}
};

Expand Down

0 comments on commit caa4463

Please sign in to comment.