Index: src/array.js |
diff --git a/src/array.js b/src/array.js |
index 44deff7de42c60986741615b1be389f9668dbf85..bef757830919c3f88b92d1e58ba2af8d1d8edd93 100644 |
--- a/src/array.js |
+++ b/src/array.js |
@@ -378,6 +378,14 @@ function ArrayJoin(separator) { |
var result = %_FastOneByteArrayJoin(array, separator); |
if (!IS_UNDEFINED(result)) return result; |
+ // Fast case for one-element arrays. |
+ if (length === 1) { |
+ var e = array[0]; |
+ if (IS_STRING(e)) return e; |
+ if (IS_NULL_OR_UNDEFINED(e)) return ''; |
+ return NonStringToString(e); |
+ } |
+ |
return Join(array, length, separator, ConvertToString); |
} |