Add _.trunc tests for astrals as separators.

This commit is contained in:
John-David Dalton
2015-09-18 23:48:19 -07:00
parent a4b333ceb8
commit f4ff336636
2 changed files with 27 additions and 12 deletions

View File

@@ -11149,15 +11149,14 @@
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match,
newEnd,
substring = result;
if (!separator.global) {
separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
separator = RegExp(separator.source, baseToString(reFlags.exec(separator)) + 'g');
}
separator.lastIndex = 0;
while ((match = separator.exec(substring))) {
newEnd = match.index;
var newEnd = match.index;
}
result = result.slice(0, newEnd == null ? end : newEnd);
}