Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index 4ffc020..10315aa 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -438,16 +438,13 @@
return ContextLocalMaybeAssignedFlag::decode(value);
}
-
-bool ScopeInfo::LocalIsSynthetic(int var) {
- DCHECK(0 <= var && var < LocalCount());
+bool ScopeInfo::VariableIsSynthetic(String* name) {
// There's currently no flag stored on the ScopeInfo to indicate that a
// variable is a compiler-introduced temporary. However, to avoid conflict
// with user declarations, the current temporaries like .generator_object and
// .result start with a dot, so we can use that as a flag. It's a hack!
- Handle<String> name(LocalName(var));
- return (name->length() > 0 && name->Get(0) == '.') ||
- name->Equals(*GetIsolate()->factory()->this_string());
+ return name->length() == 0 || name->Get(0) == '.' ||
+ name->Equals(name->GetHeap()->this_string());
}