Chromium Code Reviews| 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,6 @@ |
| if (regexp->TypeTag() == JSRegExp::ATOM) { |
| Handle<String> pattern( |
| String::cast(regexp->DataAt(JSRegExp::kAtomPatternIndex))); |
|
Lasse Reichstein
2010/11/30 11:34:38
Add an ASSERT(pattern->IsFlat()); somewhere, just
sandholm
2010/11/30 11:55:24
Done.
|
| - if (!pattern->IsFlat()) FlattenString(pattern); |
| if (SearchStringMultiple(subject, pattern, last_match_info, &builder)) { |
| return *builder.ToJSArray(result_array); |
| } |