Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index a3061dc8303150415119fdbb7c954f7eb34548fa..24510e3da77c339a120564d12c04cbf1fdfb5a15 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -3955,10 +3955,12 @@ void Parser::ThrowPendingError() { |
isolate()->debug()->OnCompileError(script_); |
Handle<JSArray> array = factory->NewJSArrayWithElements(elements); |
- Handle<Object> result = pending_error_is_reference_error_ |
- ? factory->NewReferenceError(pending_error_message_, array) |
- : factory->NewSyntaxError(pending_error_message_, array); |
- isolate()->Throw(*result, &location); |
+ Handle<Object> error; |
+ MaybeHandle<Object> maybe_error = |
+ pending_error_is_reference_error_ |
+ ? factory->NewReferenceError(pending_error_message_, array) |
+ : factory->NewSyntaxError(pending_error_message_, array); |
+ if (maybe_error.ToHandle(&error)) isolate()->Throw(*error, &location); |
} |
} |