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

Unified Diff: src/variables.h

Issue 1382513003: Test for var declarations in eval which conflict with let (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mask out eval bit Created 5 years, 2 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
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.h
diff --git a/src/variables.h b/src/variables.h
index 1c6290dff45315444b8d4e287dffabf37da035e8..a9cd5dcfec735a13ac4304252a48721cefde4c1e 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -124,6 +124,8 @@ class Variable: public ZoneObject {
index_ = index;
}
+ void SetFromEval() { is_from_eval_ = true; }
+
static int CompareIndex(Variable* const* v, Variable* const* w);
void RecordStrongModeReference(int start_position, int end_position) {
@@ -144,6 +146,16 @@ class Variable: public ZoneObject {
int strong_mode_reference_end_position() const {
return strong_mode_reference_end_position_;
}
+ PropertyAttributes DeclarationPropertyAttributes() const {
+ int property_attributes = NONE;
+ if (IsImmutableVariableMode(mode_)) {
+ property_attributes |= READ_ONLY;
+ }
+ if (is_from_eval_) {
+ property_attributes |= EVAL_DECLARED;
+ }
+ return static_cast<PropertyAttributes>(property_attributes);
+ }
private:
Scope* scope_;
@@ -165,6 +177,9 @@ class Variable: public ZoneObject {
// binding scope (exclusive).
Variable* local_if_not_shadowed_;
+ // True if this variable is introduced by a sloppy eval
+ bool is_from_eval_;
+
// Usage info.
bool force_context_allocation_; // set by variable resolver
bool is_used_;
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698