This case handles all one-element arrays that were not handled by _FastOneByteArrayJoin
BUG=
R=yangguo@chromium.org
Review URL: https://codereview.chromium.org/
607503004
Patch from Fadi Meawad <fmeawad@chromium.org>.
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24334
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
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);
}