Index: src/runtime/runtime-forin.cc |
diff --git a/src/runtime/runtime-forin.cc b/src/runtime/runtime-forin.cc |
index 916ff17a9ebfd2c13083f82e25701549d209f0bd..48ddebb672089b2337eceeea0156d8c314815b28 100644 |
--- a/src/runtime/runtime-forin.cc |
+++ b/src/runtime/runtime-forin.cc |
@@ -101,11 +101,6 @@ MaybeHandle<Object> HasEnumerableProperty(Isolate* isolate, |
return isolate->factory()->undefined_value(); |
} |
-MaybeHandle<Object> Filter(Handle<JSReceiver> receiver, Handle<Object> key) { |
- Isolate* const isolate = receiver->GetIsolate(); |
- return HasEnumerableProperty(isolate, receiver, key); |
-} |
- |
} // namespace |
@@ -157,13 +152,24 @@ RUNTIME_FUNCTION(Runtime_ForInDone) { |
return isolate->heap()->ToBoolean(index == length); |
} |
+RUNTIME_FUNCTION(Runtime_ForInHasProperty) { |
+ HandleScope scope(isolate); |
+ DCHECK_EQ(2, args.length()); |
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
+ Handle<Object> result; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, HasEnumerableProperty(isolate, receiver, key)); |
+ return isolate->heap()->ToBoolean(!result->IsUndefined(isolate)); |
+} |
RUNTIME_FUNCTION(Runtime_ForInFilter) { |
HandleScope scope(isolate); |
DCHECK_EQ(2, args.length()); |
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
- RETURN_RESULT_OR_FAILURE(isolate, Filter(receiver, key)); |
+ RETURN_RESULT_OR_FAILURE(isolate, |
+ HasEnumerableProperty(isolate, receiver, key)); |
} |
@@ -179,7 +185,8 @@ RUNTIME_FUNCTION(Runtime_ForInNext) { |
if (receiver->map() == *cache_type) { |
return *key; |
} |
- RETURN_RESULT_OR_FAILURE(isolate, Filter(receiver, key)); |
+ RETURN_RESULT_OR_FAILURE(isolate, |
+ HasEnumerableProperty(isolate, receiver, key)); |
} |