| Index: src/string.js
|
| diff --git a/src/string.js b/src/string.js
|
| index a04b23f7dbb0e54e1b9df385d275a27465e2220d..7e186871ba87547466eec7cc7eb2b714d3074e48 100644
|
| --- a/src/string.js
|
| +++ b/src/string.js
|
| @@ -644,6 +644,8 @@ function StringSplit(separator, limit) {
|
| }
|
|
|
|
|
| +var ArrayPushBuiltin = $Array.prototype.push;
|
| +
|
| function StringSplitOnRegExp(subject, separator, limit, length) {
|
| %_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]);
|
|
|
| @@ -663,13 +665,15 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
|
| while (true) {
|
|
|
| if (startIndex === length) {
|
| - result.push(%_SubString(subject, currentIndex, length));
|
| + %_CallFunction(result, %_SubString(subject, currentIndex, length),
|
| + ArrayPushBuiltin);
|
| break;
|
| }
|
|
|
| var matchInfo = DoRegExpExec(separator, subject, startIndex);
|
| if (matchInfo == null || length === (startMatch = matchInfo[CAPTURE0])) {
|
| - result.push(%_SubString(subject, currentIndex, length));
|
| + %_CallFunction(result, %_SubString(subject, currentIndex, length),
|
| + ArrayPushBuiltin);
|
| break;
|
| }
|
| var endIndex = matchInfo[CAPTURE1];
|
| @@ -680,7 +684,8 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
|
| continue;
|
| }
|
|
|
| - result.push(%_SubString(subject, currentIndex, startMatch));
|
| + %_CallFunction(result, %_SubString(subject, currentIndex, startMatch),
|
| + ArrayPushBuiltin);
|
|
|
| if (result.length === limit) break;
|
|
|
| @@ -689,9 +694,10 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
|
| var start = matchInfo[i++];
|
| var end = matchInfo[i++];
|
| if (end != -1) {
|
| - result.push(%_SubString(subject, start, end));
|
| + %_CallFunction(result, %_SubString(subject, start, end),
|
| + ArrayPushBuiltin);
|
| } else {
|
| - result.push(void 0);
|
| + %_CallFunction(result, void 0, ArrayPushBuiltin);
|
| }
|
| if (result.length === limit) break outer_loop;
|
| }
|
|
|