Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 810a8b92210d4bb2389d024490c65b0b88e22eb1..672ff51aa3f2bbcd74138f99fad982f0741d338a 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10197,12 +10197,14 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { |
if (var->IsUnallocated()) { |
Bailout(kDeleteWithGlobalVariable); |
} else if (var->IsStackAllocated() || var->IsContextSlot()) { |
- // Result of deleting non-global variables is false. 'this' is not |
- // really a variable, though we implement it as one. The |
- // subexpression does not have side effects. |
- HValue* value = var->is_this() |
- ? graph()->GetConstantTrue() |
- : graph()->GetConstantFalse(); |
+ // Result of deleting non-global variables is false. 'this' is not really |
+ // a variable, though we implement it as one. The subexpression does not |
+ // have side effects. (It could be that the "this" variable has DYNAMIC |
+ // resolution though so we haven't been able to map it to Variable::THIS, |
+ // but regardless if its name is "this" then it is "this".) |
+ bool is_this = *var->name() == *isolate()->factory()->this_string(); |
+ HValue* value = |
+ is_this ? graph()->GetConstantTrue() : graph()->GetConstantFalse(); |
return ast_context()->ReturnValue(value); |
} else { |
Bailout(kDeleteWithNonGlobalVariable); |