Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 83e2fc50d5d43db6290b9e7808313d6806ebe97a..8ca475a5c8ab649ec6a15e517ca14a823dcaabbd 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -561,7 +561,11 @@ Handle<Value> Shell::CreateExternalArray(const Arguments& args, |
if (init_from_array) { |
Handle<Object> init = args[0]->ToObject(); |
- for (int i = 0; i < length; ++i) array->Set(i, init->Get(i)); |
+ for (int i = 0; i < length; ++i) { |
+ Local<Value> value = init->Get(i); |
+ if (try_catch.HasCaught()) return try_catch.ReThrow(); |
+ array->Set(i, value); |
+ } |
} |
return array; |