Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index a10640f1911b40edc9c519f711b03d9c1aa8cdfd..272eef1f316789e647efbfb04eed2be3431dae7e 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1442,9 +1442,11 @@ void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { |
} |
try_control.EndTry(); |
- // Clear message object as we enter the catch block. |
- Node* the_hole = jsgraph()->TheHoleConstant(); |
- NewNode(javascript()->StoreMessage(), the_hole); |
+ // If requested, clear message object as we enter the catch block. |
+ if (stmt->clear_pending_message()) { |
+ Node* the_hole = jsgraph()->TheHoleConstant(); |
+ NewNode(javascript()->StoreMessage(), the_hole); |
+ } |
// Create a catch scope that binds the exception. |
Node* exception = try_control.GetExceptionNode(); |