Index: src/variables.h |
diff --git a/src/variables.h b/src/variables.h |
index 93bfb4a1816aeb3fb9f370c847ace86da6f2d6b3..d150e0fa30d4a6f6632d3493a17de3c96fc41ff8 100644 |
--- a/src/variables.h |
+++ b/src/variables.h |
@@ -135,6 +135,19 @@ class Variable: public ZoneObject { |
static int CompareIndex(Variable* const* v, Variable* const* w); |
+ // Shall an error be thrown if assignment with 'op' operation is perfomed |
+ // on this variable in given language mode? |
+ bool IsSignallingAssignmentToConst(Token::Value op, |
rossberg
2014/11/26 08:31:46
Can you also move this to full-codegen.h? This is
Dmitry Lomov (no reviews)
2014/11/26 10:30:56
Done.
|
+ StrictMode strict_mode) const { |
+ if (strict_mode == SLOPPY) return false; |
+ |
+ if (mode() == CONST) return op != Token::INIT_CONST; |
+ |
+ if (mode() == CONST_LEGACY) return op != Token::INIT_CONST_LEGACY; |
+ |
+ return false; |
+ } |
+ |
private: |
Scope* scope_; |
const AstRawString* name_; |