Add length check to avoid extra work in initArrayClone.

This commit is contained in:
John-David Dalton
2014-08-08 10:43:26 -07:00
parent 916c728d70
commit df4e306c64

View File

@@ -2849,7 +2849,7 @@
}
}
// add array properties assigned by `RegExp#exec`
if (typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}