| Index: src/regexp.js
|
| ===================================================================
|
| --- src/regexp.js (revision 8501)
|
| +++ src/regexp.js (working copy)
|
| @@ -235,7 +235,7 @@
|
| // Conversion is required by the ES5 specification (RegExp.prototype.exec
|
| // algorithm, step 5) even if the value is discarded for non-global RegExps.
|
| var i = TO_INTEGER(lastIndex);
|
| -
|
| +
|
| if (this.global) {
|
| if (i < 0 || i > string.length) {
|
| this.lastIndex = 0;
|
| @@ -250,11 +250,11 @@
|
| }
|
| lastMatchInfoOverride = null;
|
| this.lastIndex = lastMatchInfo[CAPTURE1];
|
| - return true;
|
| + return true;
|
| } else {
|
| // Non-global regexp.
|
| - // Remove irrelevant preceeding '.*' in a non-global test regexp.
|
| - // The expression checks whether this.source starts with '.*' and
|
| + // Remove irrelevant preceeding '.*' in a non-global test regexp.
|
| + // The expression checks whether this.source starts with '.*' and
|
| // that the third char is not a '?'.
|
| if (%_StringCharCodeAt(this.source, 0) == 46 && // '.'
|
| %_StringCharCodeAt(this.source, 1) == 42 && // '*'
|
| @@ -262,14 +262,14 @@
|
| if (!%_ObjectEquals(regexp_key, this)) {
|
| regexp_key = this;
|
| regexp_val = new $RegExp(SubString(this.source, 2, this.source.length),
|
| - (!this.ignoreCase
|
| + (!this.ignoreCase
|
| ? !this.multiline ? "" : "m"
|
| : !this.multiline ? "i" : "im"));
|
| }
|
| if (%_RegExpExec(regexp_val, string, 0, lastMatchInfo) === null) {
|
| return false;
|
| }
|
| - }
|
| + }
|
| %_Log('regexp', 'regexp-exec,%0r,%1S,%2i', [this, string, lastIndex]);
|
| // matchIndices is either null or the lastMatchInfo array.
|
| var matchIndices = %_RegExpExec(this, string, 0, lastMatchInfo);
|
|
|