From a9a95de02d605f30c7e5de1d332d8025be4cc12b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 17 Jan 2015 20:15:11 -0800 Subject: [PATCH] Use `baseToString` in `_.repeat`. --- lodash.src.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 5d93b2a31..e53dc4612 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -9603,13 +9603,11 @@ */ function repeat(string, n) { var result = ''; + string = baseToString(string); n = +n; - - if (n < 1 || string == null || !nativeIsFinite(n)) { + if (n < 1 || !string || !nativeIsFinite(n)) { return result; } - string = (string + ''); - // Leverage the exponentiation by squaring algorithm for a faster repeat. // See http://en.wikipedia.org/wiki/Exponentiation_by_squaring. do {