Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1807)

Unified Diff: runtime/lib/regexp_jsc.cc

Issue 9718015: Make failed capturing parenthesis produce null instead of "". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: eliminate merge residue Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/regexp_jsc.cc
diff --git a/runtime/lib/regexp_jsc.cc b/runtime/lib/regexp_jsc.cc
index 0066aa7cc5457cac31d25ecc4846878c38d34400..5b34d159d9d67eda519e6cf4d313ff6b506e4d22 100644
--- a/runtime/lib/regexp_jsc.cc
+++ b/runtime/lib/regexp_jsc.cc
@@ -156,13 +156,11 @@ RawArray* Jscre::Execute(const JSRegExp& regex,
const int kMatchPair = 2;
siva 2012/03/19 18:29:14 ASSERT(retval <= (num_bracket_expressions + 1));
Array& array =
- Array::Handle(Array::New(kMatchPair * (num_bracket_expressions + 1)));
+ Array::Handle(Array::New(kMatchPair * retval));
// The matches come in (start, end + 1) pairs for each bracketted expression.
Smi& start = Smi::Handle();
Smi& end = Smi::Handle();
- for (intptr_t i = 0;
- i < (kMatchPair * (num_bracket_expressions + 1));
- i += kMatchPair) {
+ for (intptr_t i = 0; i < (kMatchPair * retval); i += kMatchPair) {
start = Smi::New(offsets[i]);
end = Smi::New(offsets[i + 1]);
array.SetAt(i, start);

Powered by Google App Engine
This is Rietveld 408576698