Author: [email protected]
Date: Tue May 19 02:11:30 2009
New Revision: 1997
Modified:
branches/bleeding_edge/src/runtime.cc
Log:
Add 2 asserts in search-replace implementation.
Review URL: http://codereview.chromium.org/115507
Modified: branches/bleeding_edge/src/runtime.cc
==============================================================================
--- branches/bleeding_edge/src/runtime.cc (original)
+++ branches/bleeding_edge/src/runtime.cc Tue May 19 02:11:30 2009
@@ -1420,6 +1420,7 @@
void AddElement(Object* element) {
ASSERT(element->IsSmi() || element->IsString());
+ ASSERT(parts_->length() > part_count_);
parts_->set(part_count_, element);
part_count_++;
}
@@ -1589,6 +1590,7 @@
if (i > last) {
parts->Add(ReplacementPart::ReplacementSubString(last, i));
}
+ ASSERT(capture_ref <= capture_count);
parts->Add(ReplacementPart::SubjectCapture(capture_ref));
last = next_index + 1;
}
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---