Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: src/ast/variables.h

Issue 2231813003: Make Variable::is_this always return the correct value (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove patch Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 950db3c0021263f93209609d24cfd61de8a2d58f..d6af7083b83e3c5ab9da717a6398b2e4c3098cc1 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -80,22 +80,6 @@ class Variable: public ZoneObject {
bool is_this() const { return kind_ == THIS; }
bool is_arguments() const { return kind_ == ARGUMENTS; }
- // For script scopes, the "this" binding is provided by a ScriptContext added
- // to the global's ScriptContextTable. This binding might not statically
- // resolve to a Variable::THIS binding, instead being DYNAMIC_LOCAL. However
- // any variable named "this" does indeed refer to a Variable::THIS binding;
- // the grammar ensures this to be the case. So wherever a "this" binding
- // might be provided by the global, use HasThisName instead of is_this().
- bool HasThisName(Isolate* isolate,
- HandleDereferenceMode deref_mode =
- HandleDereferenceMode::kAllowed) const {
- // Note: it is safe to dereference isolate->factory()->this_string() here
- // regardless of |deref_mode| because it is a constant root and so will
- // never be updated or moved.
- return is_this() ||
- name_is_identical_to(isolate->factory()->this_string(), deref_mode);
- }
-
// True if the variable is named eval and not known to be shadowed.
bool is_possibly_eval(Isolate* isolate,
HandleDereferenceMode deref_mode =

Powered by Google App Engine
This is Rietveld 408576698