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

Unified Diff: src/scopes.cc

Issue 6312055: Pass strict mode flag to eval. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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
« src/runtime.cc ('K') | « src/scopes.h ('k') | src/variables.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index d3f54ad3f2d9ad8b47fefae2d89fd692bd3e2eda..e23e1cbe2292eb3d35f65517c36c6b8eb7bf651f 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -490,6 +490,13 @@ int Scope::ContextChainLength(Scope* scope) {
return n;
}
+// In strict mode, arguments are const.
+void Scope::SetAttributesConst() {
+ Variable* arguments = LocalLookup(Factory::arguments_symbol());
+ ASSERT(arguments != NULL); // functions have 'arguments' declared implicitly
+ ASSERT(arguments->mode() == Variable::VAR);
+ arguments->set_mode(Variable::CONST);
+}
#ifdef DEBUG
static const char* Header(Scope::Type type) {
« src/runtime.cc ('K') | « src/scopes.h ('k') | src/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698