Index: src/runtime/runtime-strings.cc |
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc |
index e3b589643b474ce291a0d668f669316d8e40f2cb..6786fa99fba0f92e1c41e5e228d9f6852349dd74 100644 |
--- a/src/runtime/runtime-strings.cc |
+++ b/src/runtime/runtime-strings.cc |
@@ -371,14 +371,13 @@ RUNTIME_FUNCTION(Runtime_StringMatch) { |
Handle<String> substring = |
isolate->factory()->NewSubString(subject, offsets.at(0), offsets.at(1)); |
elements->set(0, *substring); |
- for (int i = 1; i < matches; i++) { |
- HandleScope temp_scope(isolate); |
+ FOR_WITH_HANDLE_SCOPE(isolate, int, i = 1, i, i < matches, i++, { |
int from = offsets.at(i * 2); |
int to = offsets.at(i * 2 + 1); |
Handle<String> substring = |
isolate->factory()->NewProperSubString(subject, from, to); |
elements->set(i, *substring); |
- } |
+ }); |
Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(elements); |
result->set_length(Smi::FromInt(matches)); |
return *result; |