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

Unified Diff: src/scopes.h

Issue 716833002: Various clean-ups after top-level lexical declarations are done. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 25305de1e1fd2c565d4db9b7243ca96fa7680fec..ea6917195595f2232b274acf395198285fb41d73 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -80,7 +80,7 @@ class Scope: public ZoneObject {
// doesn't re-allocate variables repeatedly.
static bool Analyze(CompilationInfo* info);
- static Scope* DeserializeScopeChain(Context* context, Scope* global_scope,
+ static Scope* DeserializeScopeChain(Context* context, Scope* script_scope,
Zone* zone);
// The scope name is only used for printing/debugging.
@@ -135,7 +135,7 @@ class Scope: public ZoneObject {
Interface* interface = Interface::NewValue());
// Declare an implicit global variable in this scope which must be a
- // global scope. The variable was introduced (possibly from an inner
+ // script scope. The variable was introduced (possibly from an inner
// scope) by a reference to an unresolved variable with no intervening
// with statements or eval calls.
Variable* DeclareDynamicGlobal(const AstRawString* name);
@@ -209,7 +209,7 @@ class Scope: public ZoneObject {
void RecordWithStatement() { scope_contains_with_ = true; }
// Inform the scope that the corresponding code contains an eval call.
- void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; }
+ void RecordEvalCall() { if (!is_script_scope()) scope_calls_eval_ = true; }
// Inform the scope that the corresponding code uses "this".
void RecordThisUsage() { scope_uses_this_ = true; }
@@ -272,14 +272,14 @@ class Scope: public ZoneObject {
return scope_type_ == FUNCTION_SCOPE || scope_type_ == ARROW_SCOPE;
}
bool is_module_scope() const { return scope_type_ == MODULE_SCOPE; }
- bool is_global_scope() const { return scope_type_ == GLOBAL_SCOPE; }
+ bool is_script_scope() const { return scope_type_ == SCRIPT_SCOPE; }
bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; }
bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; }
bool is_with_scope() const { return scope_type_ == WITH_SCOPE; }
bool is_arrow_scope() const { return scope_type_ == ARROW_SCOPE; }
bool is_declaration_scope() const {
return is_eval_scope() || is_function_scope() ||
- is_module_scope() || is_global_scope();
+ is_module_scope() || is_script_scope();
}
bool is_strict_eval_scope() const {
return is_eval_scope() && strict_mode_ == STRICT;
@@ -372,7 +372,7 @@ class Scope: public ZoneObject {
int StackLocalCount() const;
int ContextLocalCount() const;
- // For global scopes, the number of module literals (including nested ones).
+ // For script scopes, the number of module literals (including nested ones).
int num_modules() const { return num_modules_; }
// For module scopes, the host scope's internal variable binding this module.
@@ -396,8 +396,8 @@ class Scope: public ZoneObject {
// The number of contexts between this and scope; zero if this == scope.
int ContextChainLength(Scope* scope);
- // Find the innermost global scope.
- Scope* GlobalScope();
+ // Find the innermost script scope.
rossberg 2014/11/12 09:49:27 Nit: remove "innermost". Do we actually still need
Dmitry Lomov (no reviews) 2014/11/12 10:16:27 Done. It is used in for modules.
+ Scope* ScriptScope();
// Find the first function, global, or eval scope. This is the scope
// where var declarations will be hoisted to in the implementation.
@@ -449,7 +449,7 @@ class Scope: public ZoneObject {
// The variables declared in this scope:
//
- // All user-declared variables (incl. parameters). For global scopes
+ // All user-declared variables (incl. parameters). For script scopes
// variables may be implicitly 'declared' by being used (possibly in
// an inner scope) with no intervening with statements or eval calls.
VariableMap variables_;
@@ -555,14 +555,14 @@ class Scope: public ZoneObject {
// The variable reference could not be statically resolved to any binding
// and thus should be considered referencing a global variable. NULL is
// returned. The variable reference is not inside any 'with' statement and
- // no scope between the reference scope (inclusive) and global scope
+ // no scope between the reference scope (inclusive) and script scope
// (exclusive) makes a sloppy 'eval' call.
UNBOUND,
// The variable reference could not be statically resolved to any binding
// NULL is returned. The variable reference is not inside any 'with'
// statement, but some scope between the reference scope (inclusive) and
- // global scope (exclusive) makes a sloppy 'eval' call, that might
+ // script scope (exclusive) makes a sloppy 'eval' call, that might
// possibly introduce a variable binding. Thus the reference should be
// considered referencing a global variable unless it is shadowed by an
// 'eval' introduced binding.

Powered by Google App Engine
This is Rietveld 408576698