Index: src/messages.cc |
diff --git a/src/messages.cc b/src/messages.cc |
index 67ab36f6cf0af2f6cc65a17fb3b69589d8eeedd8..1f8f8cf789bbb68748813c1ebbfc60ccd000aa47 100644 |
--- a/src/messages.cc |
+++ b/src/messages.cc |
@@ -116,8 +116,7 @@ void MessageHandler::ReportMessage(Isolate* isolate, MessageLocation* loc, |
isolate->clear_scheduled_exception(); |
} |
} else { |
- for (int i = 0; i < global_length; i++) { |
- HandleScope scope(isolate); |
+ FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < global_length, i++, { |
if (global_listeners.get(i)->IsUndefined()) continue; |
v8::NeanderObject listener(JSObject::cast(global_listeners.get(i))); |
Handle<Foreign> callback_obj(Foreign::cast(listener.get(0))); |
@@ -134,7 +133,7 @@ void MessageHandler::ReportMessage(Isolate* isolate, MessageLocation* loc, |
if (isolate->has_scheduled_exception()) { |
isolate->clear_scheduled_exception(); |
} |
- } |
+ }); |
} |
} |
@@ -262,8 +261,7 @@ Handle<Object> CallSite::GetMethodName() { |
Handle<JSObject> current_obj = Handle<JSObject>::cast(current); |
if (current_obj->IsAccessCheckNeeded()) break; |
Handle<FixedArray> keys = JSObject::GetEnumPropertyKeys(current_obj); |
- for (int i = 0; i < keys->length(); i++) { |
- HandleScope inner_scope(isolate_); |
+ FOR_WITH_HANDLE_SCOPE(isolate_, int, i = 0, i, i < keys->length(), i++, { |
if (!keys->get(i)->IsName()) continue; |
Handle<Name> name_key(Name::cast(keys->get(i)), isolate_); |
if (!CheckMethodName(isolate_, current_obj, name_key, fun_, |
@@ -271,8 +269,8 @@ Handle<Object> CallSite::GetMethodName() { |
continue; |
// Return null in case of duplicates to avoid confusion. |
if (!result.is_null()) return isolate_->factory()->null_value(); |
- result = inner_scope.CloseAndEscape(name_key); |
- } |
+ result = loop_scope.CloseAndEscape(name_key); |
+ }); |
} |
if (!result.is_null()) return outer_scope.CloseAndEscape(result); |