Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 66c778b88a6a12c06d67d51a83909dc3184b373d..f623f666ca8abd6ef6bf5ce91f644ac5d15bd40b 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1199,8 +1199,9 @@ void AstGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) { |
void AstGraphBuilder::VisitWithStatement(WithStatement* stmt) { |
VisitForValue(stmt->expression()); |
Node* value = environment()->Pop(); |
+ Node* object = BuildToObject(value, stmt->ToObjectId()); |
const Operator* op = javascript()->CreateWithContext(); |
- Node* context = NewNode(op, value, GetFunctionClosureForContext()); |
+ Node* context = NewNode(op, object, GetFunctionClosureForContext()); |
PrepareFrameState(context, stmt->EntryId()); |
VisitInScope(stmt->statement(), stmt->scope(), context); |
} |