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

Unified Diff: src/scopes.cc

Issue 6976025: Simplify the Scope API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Clarify comment. Created 9 years, 7 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/scopes.h ('k') | no next file » | 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 61024426e3ca9b76545e25b3b5ef373733f2697a..e159257164086840e690f66f4006a202fb00df54 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -366,17 +366,22 @@ Variable* Scope::DeclareFunctionVar(Handle<String> name) {
}
-Variable* Scope::DeclareLocal(Handle<String> name,
- Variable::Mode mode,
- LocalType type) {
- // DYNAMIC variables are introduces during variable allocation,
- // INTERNAL variables are allocated explicitly, and TEMPORARY
- // variables are allocated via NewTemporary().
+void Scope::DeclareParameter(Handle<String> name) {
ASSERT(!resolved());
+ ASSERT(is_function_scope());
+ Variable* var =
+ variables_.Declare(this, name, Variable::VAR, true, Variable::NORMAL);
+ params_.Add(var);
+}
+
+
+Variable* Scope::DeclareLocal(Handle<String> name, Variable::Mode mode) {
+ ASSERT(!resolved());
+ // This function handles VAR and CONST modes. DYNAMIC variables are
+ // introduces during variable allocation, INTERNAL variables are allocated
+ // explicitly, and TEMPORARY variables are allocated via NewTemporary().
ASSERT(mode == Variable::VAR || mode == Variable::CONST);
- if (type == VAR_OR_CONST) {
- num_var_or_const_++;
- }
+ ++num_var_or_const_;
return variables_.Declare(this, name, mode, true, Variable::NORMAL);
}
@@ -388,13 +393,6 @@ Variable* Scope::DeclareGlobal(Handle<String> name) {
}
-void Scope::AddParameter(Variable* var) {
- ASSERT(is_function_scope());
- ASSERT(LocalLookup(var->name()) == var);
- params_.Add(var);
-}
-
-
VariableProxy* Scope::NewUnresolved(Handle<String> name,
bool inside_with,
int position) {
« no previous file with comments | « src/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698