| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index d4eb17cd5688888cea14ae9cee832d851f25f59b..c2c41799b93fdb94590bff2eb7e01a8d7016d700 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -93,7 +93,8 @@ class Scope: public ZoneObject {
|
| EVAL_SCOPE, // The top-level scope for an eval source.
|
| FUNCTION_SCOPE, // The top-level scope for a function.
|
| GLOBAL_SCOPE, // The top-level scope for a program or a top-level eval.
|
| - CATCH_SCOPE // The scope introduced by catch.
|
| + CATCH_SCOPE, // The scope introduced by catch.
|
| + BLOCK_SCOPE // The scope introduced by a new block.
|
| };
|
|
|
| Scope(Scope* outer_scope, Type type);
|
| @@ -204,6 +205,7 @@ class Scope: public ZoneObject {
|
| bool is_function_scope() const { return type_ == FUNCTION_SCOPE; }
|
| bool is_global_scope() const { return type_ == GLOBAL_SCOPE; }
|
| bool is_catch_scope() const { return type_ == CATCH_SCOPE; }
|
| + bool is_block_scope() const { return type_ == BLOCK_SCOPE; }
|
| bool is_strict_mode() const { return strict_mode_; }
|
| bool is_strict_mode_eval_scope() const {
|
| return is_eval_scope() && is_strict_mode();
|
| @@ -294,6 +296,8 @@ class Scope: public ZoneObject {
|
| // where var declarations will be hoisted to in the implementation.
|
| Scope* DeclarationScope();
|
|
|
| + Handle<SerializedScopeInfo> GetSerializedScopeInfo();
|
| +
|
| // ---------------------------------------------------------------------------
|
| // Strict mode support.
|
| bool IsDeclared(Handle<String> name) {
|
| @@ -397,7 +401,7 @@ class Scope: public ZoneObject {
|
|
|
| // Variable resolution.
|
| Variable* LookupRecursive(Handle<String> name,
|
| - bool inner_lookup,
|
| + bool from_inner_function,
|
| Variable** invalidated_local);
|
| void ResolveVariable(Scope* global_scope,
|
| Handle<Context> context,
|
| @@ -425,8 +429,8 @@ class Scope: public ZoneObject {
|
| void AllocateVariablesRecursively();
|
|
|
| private:
|
| - // Construct a function scope based on the scope info.
|
| - Scope(Scope* inner_scope, Handle<SerializedScopeInfo> scope_info);
|
| + // Construct a function or block scope based on the scope info.
|
| + Scope(Scope* inner_scope, Type type, Handle<SerializedScopeInfo> scope_info);
|
|
|
| // Construct a catch scope with a binding for the name.
|
| Scope(Scope* inner_scope, Handle<String> catch_variable_name);
|
|
|