Chromium Code Reviews| Index: src/ast/scopeinfo.cc |
| diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc |
| index d3014274d40bf1abdf2cb708fdcde9f0be9bb273..8f4bdb625874f22e9ac98868242a11c6deac22df 100644 |
| --- a/src/ast/scopeinfo.cc |
| +++ b/src/ast/scopeinfo.cc |
| @@ -618,6 +618,14 @@ bool ScopeInfo::VariableIsSynthetic(String* name) { |
| name->Equals(name->GetHeap()->this_string()); |
| } |
| +bool Scope::VariableIsSynthetic(const AstRawString* name) { |
|
adamk
2016/09/19 20:01:25
Yikes, I think this should be in scopes.cc. If you
|
| + // 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! |
| + return name->length() == 0 || name->FirstCharacter() == '.' || |
| + name->IsOneByteEqualTo("this"); |
| +} |
| int ScopeInfo::StackSlotIndex(String* name) { |
| DCHECK(name->IsInternalizedString()); |