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_; |