Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index a03b7411c3cdf7b9cef5722a393a726ff62b5905..acab9d86f58cc977c13a961015e7c429fbf17a28 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -2874,8 +2874,10 @@ Local<Array> v8::Object::GetPropertyNames() { |
ENTER_V8(isolate); |
i::HandleScope scope(isolate); |
i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
+ bool threw = false; |
i::Handle<i::FixedArray> value = |
- i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS); |
+ i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS, &threw); |
+ if (threw) return Local<v8::Array>(); |
// Because we use caching to speed up enumeration it is important |
// to never change the result of the basic enumeration function so |
// we clone the result. |
@@ -2893,8 +2895,10 @@ Local<Array> v8::Object::GetOwnPropertyNames() { |
ENTER_V8(isolate); |
i::HandleScope scope(isolate); |
i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
+ bool threw = false; |
i::Handle<i::FixedArray> value = |
- i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY); |
+ i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY, &threw); |
+ if (threw) return Local<v8::Array>(); |
// Because we use caching to speed up enumeration it is important |
// to never change the result of the basic enumeration function so |
// we clone the result. |