Changeset 62148 in webkit for trunk/JavaScriptCore/runtime/RegExp.cpp
- Timestamp:
- Jun 29, 2010, 3:01:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/RegExp.cpp
r61927 r62148 52 52 , m_constructionError(0) 53 53 , m_numSubpatterns(0) 54 , m_lastMatchStart(-1) 54 55 { 55 56 compile(globalData); … … 61 62 , m_constructionError(0) 62 63 , m_numSubpatterns(0) 64 , m_lastMatchStart(-1) 63 65 { 64 66 // NOTE: The global flag is handled on a case-by-case basis by functions like … … 110 112 ovector->resize(0); 111 113 112 if (static_cast<unsigned>(startOffset) > s.size() || s.isNull()) 114 if (static_cast<unsigned>(startOffset) > s.size() || s.isNull()) { 115 m_lastMatchString = UString(); 116 m_lastMatchStart = -1; 117 m_lastOVector.shrink(0); 113 118 return -1; 119 } 120 121 // Perform check to see if this match call is the same as the last match invocation 122 // and if it is return the prior result. 123 if ((startOffset == m_lastMatchStart) && (s.rep() == m_lastMatchString.rep())) { 124 if (ovector) 125 *ovector = m_lastOVector; 126 127 if (m_lastOVector.isEmpty()) 128 return -1; 129 130 return m_lastOVector.at(0); 131 } 114 132 115 133 #if ENABLE(YARR_JIT) … … 148 166 ovector->clear(); 149 167 } 168 169 m_lastMatchString = s; 170 m_lastMatchStart = startOffset; 171 172 if (ovector) 173 m_lastOVector = *ovector; 174 else 175 m_lastOVector = nonReturnedOvector; 176 150 177 return result; 151 178 } 179 180 m_lastMatchString = UString(); 181 m_lastMatchStart = -1; 182 m_lastOVector.shrink(0); 152 183 153 184 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.