summaryrefslogtreecommitdiff
path: root/deps/v8/src/regexp.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-04-27 00:31:47 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-04-27 00:31:47 -0700
commit24931f840544c9970203660121a1ec4606bdd4f1 (patch)
treef22539325eb06fc50879d9d4f327cf6c83645891 /deps/v8/src/regexp.js
parent2374e557e30fab5c357d3f03716ca3b83131c3c0 (diff)
downloadnode-new-24931f840544c9970203660121a1ec4606bdd4f1.tar.gz
Upgrade V8 to 2.2.5
Diffstat (limited to 'deps/v8/src/regexp.js')
-rw-r--r--deps/v8/src/regexp.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/deps/v8/src/regexp.js b/deps/v8/src/regexp.js
index 9929b112e8..24e3309805 100644
--- a/deps/v8/src/regexp.js
+++ b/deps/v8/src/regexp.js
@@ -115,7 +115,9 @@ function CompileRegExp(pattern, flags) {
function DoRegExpExec(regexp, string, index) {
- return %_RegExpExec(regexp, string, index, lastMatchInfo);
+ var result = %_RegExpExec(regexp, string, index, lastMatchInfo);
+ if (result !== null) lastMatchInfoOverride = null;
+ return result;
}
@@ -136,7 +138,7 @@ var regExpCache = new RegExpCache();
function CloneRegExpResult(array) {
- if (array == null) return null;
+ if (array == null) return null;
var length = array.length;
var answer = %_RegExpConstructResult(length, array.index, array.input);
for (var i = 0; i < length; i++) {
@@ -237,7 +239,7 @@ function RegExpExec(string) {
cache.type = 'exec';
return matchIndices; // No match.
}
-
+ lastMatchInfoOverride = null;
var result = BuildResultFromMatchInfo(matchIndices, s);
if (this.global) {
@@ -312,7 +314,7 @@ function RegExpTest(string) {
cache.answer = false;
return false;
}
-
+ lastMatchInfoOverride = null;
if (this.global) this.lastIndex = lastMatchInfo[CAPTURE1];
cache.answer = true;
return true;
@@ -340,7 +342,9 @@ function RegExpToString() {
// on the captures array of the last successful match and the subject string
// of the last successful match.
function RegExpGetLastMatch() {
- if (lastMatchInfoOverride) { return lastMatchInfoOverride[0]; }
+ if (lastMatchInfoOverride !== null) {
+ return lastMatchInfoOverride[0];
+ }
var regExpSubject = LAST_SUBJECT(lastMatchInfo);
return SubString(regExpSubject,
lastMatchInfo[CAPTURE0],