Index: src/runtime.cc |
=================================================================== |
--- src/runtime.cc (revision 5888) |
+++ src/runtime.cc (working copy) |
@@ -2019,10 +2019,7 @@ |
} |
Handle<JSArray> GetParts() { |
- Handle<JSArray> result = |
- Factory::NewJSArrayWithElements(array_builder_.array()); |
- result->set_length(Smi::FromInt(array_builder_.length())); |
- return result; |
+ return array_builder_.ToJSArray(); |
} |
private: |
@@ -2597,7 +2594,7 @@ |
// Perform string match of pattern on subject, starting at start index. |
// Caller must ensure that 0 <= start_index <= sub->length(), |
-// and should check that pat->length() + start_index <= sub->length() |
+// and should check that pat->length() + start_index <= sub->length(). |
int Runtime::StringMatch(Handle<String> sub, |
Handle<String> pat, |
int start_index) { |
@@ -3196,7 +3193,7 @@ |
if (regexp->TypeTag() == JSRegExp::ATOM) { |
Handle<String> pattern( |
String::cast(regexp->DataAt(JSRegExp::kAtomPatternIndex))); |
- if (!pattern->IsFlat()) FlattenString(pattern); |
+ ASSERT(pattern->IsFlat()); |
if (SearchStringMultiple(subject, pattern, last_match_info, &builder)) { |
return *builder.ToJSArray(result_array); |
} |