Lines Matching refs:scope
414 Scope* Parser::NewScope(Scope* parent, ScopeType scope_type) {
415 Scope* result = new(zone()) Scope(parent, scope_type, zone());
466 // FunctionState and BlockState together implement the parser's scope stack.
467 // The parser's current scope is in top_scope_. The BlockState and
468 // FunctionState constructors push on the scope stack and the destructors
474 BlockState(Parser* parser, Scope* scope)
477 parser->top_scope_ = scope;
484 Scope* outer_scope_;
489 Scope* scope,
500 parser->top_scope_ = scope;
622 { Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
623 info->SetGlobalScope(scope);
625 scope = Scope::DeserializeScopeChain(*info->context(), scope, zone());
627 original_scope_ = scope;
629 if (!scope->is_global_scope() || info->language_mode() != CLASSIC_MODE) {
630 scope = NewScope(scope, EVAL_SCOPE);
633 scope = NewScope(scope, GLOBAL_SCOPE);
635 scope->set_start_position(0);
636 scope->set_end_position(source->length());
642 scope->is_eval_scope()) {
647 // Enters 'scope'.
648 FunctionState function_state(this, scope, isolate());
755 Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
756 info()->SetGlobalScope(scope);
758 scope = Scope::DeserializeScopeChain(info()->closure()->context(), scope,
761 original_scope_ = scope;
762 FunctionState function_state(this, scope, isolate());
763 ASSERT(scope->language_mode() != STRICT_MODE || !info()->is_classic_mode());
764 ASSERT(scope->language_mode() != EXTENDED_MODE ||
767 scope->SetLanguageMode(shared_info->language_mode());
865 TargetScope scope(&this->target_stack_);
902 // TODO(mstarzinger): Global strict eval calls, need their own scope
904 // add this scope in DoParseProgram(), but that requires adaptations
909 Scope* scope = NewScope(top_scope_, EVAL_SCOPE);
910 scope->set_start_position(top_scope_->start_position());
911 scope->set_end_position(top_scope_->end_position());
912 top_scope_ = scope;
1055 Scope* scope = NewScope(top_scope_, MODULE_SCOPE);
1058 scope->set_start_position(scanner().location().beg_pos);
1059 scope->SetLanguageMode(EXTENDED_MODE);
1062 BlockState block_state(this, scope);
1076 scope->set_end_position(scanner().location().end_pos);
1077 body->set_scope(scope);
1080 Interface* interface = scope->interface();
1083 if (scope->LocalLookup(it.name()) == NULL) {
1169 Scope* scope = NewScope(top_scope_, MODULE_SCOPE);
1171 body->set_scope(scope);
1172 Interface* interface = scope->interface();
1176 interface->Unify(scope->interface(), zone(), ok);
1462 // truly local variable, and the scope of the variable is always the function
1463 // scope.
1465 // enclosing scope.
1475 Scope* declaration_scope = DeclarationScope(mode);
1478 // If a suitable scope exists, then we can statically declare this
1480 // will be added to the scope so that the declaration can be added
1482 // For instance declarations inside an eval scope need to be added
1484 // Similarly, strict mode eval scope does not leak variable declarations to
1485 // the caller's scope so we declare all locals, too.
1491 // Declare the variable in the declaration scope.
1492 // For the global scope, we have to check for collisions with earlier
1494 // global scope.
1506 // The name was declared in this scope before; check for conflicting
1508 // not a var (in the global scope, we also have to ignore legacy const for
1512 // conflicting declarations within the same scope. This check also covers
1517 // because the var declaration is hoisted to the function scope where 'x'
1567 // For variable declarations in a non-strict eval scope the proxy is bound
1581 // function scope and not a statement-local scope, e.g. as provided with a
1657 // other functions are set up when entering the surrounding scope.
1690 // scope, we treat it as such and introduce the function with its
1691 // initial value upon entering the corresponding scope.
1693 // global scope.
1711 // Note that a Block does not introduce a new execution scope!
1739 Scope* block_scope = NewScope(top_scope_, BLOCK_SCOPE);
1880 Scope* declaration_scope = DeclarationScope(mode);
1882 // The scope of a var/const declared variable anywhere inside a function
1885 // Scope declaration, and rewrite the source-level initialization into an
1922 // If we have a const declaration, in an inner scope, the proxy is always
1926 // pre-resolve the proxy because it resides in the same scope as the
1970 Scope* initialization_scope = is_const ? declaration_scope : top_scope_;
2069 // is always at the function scope level. This is only relevant for
2159 // from the top scope. This way, we don't try to resolve it
2160 // during the scope processing.
2322 Scope* declaration_scope = top_scope_->DeclarationScope();
2352 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE);
2478 Scope* catch_scope = NULL;
2694 // Create an in-between scope for let-bound iteration variables.
2695 Scope* saved_scope = top_scope_;
2696 Scope* for_scope = NewScope(top_scope_, BLOCK_SCOPE);
2764 // TODO(keuchel): Move the temporary variable to the block scope, after
3660 // Update the scope information before the pre-parsing bailout.
4042 // their declaration is hoisted, but they still see the local scope. E.g.,
4056 // - (1) is the case iff the innermost scope of the deserialized scope chain
4057 // under which we compile is _not_ a declaration scope. This holds because
4059 // declaration scope and compiled relative to that.
4060 // - (2) is the case iff the current declaration scope is still the original
4061 // one relative to the deserialized scope chain. Otherwise we must be
4062 // compiling a function in an inner declaration scope in the eval, e.g. a
4064 Scope* declaration_scope = top_scope_->DeclarationScope();
4065 Scope* original_declaration_scope = original_scope_->DeclarationScope();
4066 Scope* scope =
4087 { FunctionState function_state(this, scope, isolate());
4108 scope->set_start_position(scanner().location().beg_pos);
4170 // - The outer scope must allow lazy compilation of inner functions.
4198 scope->set_end_position(entry.end_pos());
4201 scope->end_position() - function_block_pos);
4231 scope->set_end_position(logger.end());
4234 scope->end_position() - function_block_pos);
4294 scope->set_end_position(scanner().location().end_pos);
4300 int start_pos = scope->start_position();
4322 int start_pos = scope->start_position();
4337 CheckOctalLiteral(scope->start_position(),
4338 scope->end_position(),
4346 CheckConflictingVarDeclarations(scope, CHECK_OK);
4351 scope,
4509 // Parses an identifier that is valid for the current scope, in particular it
4510 // fails on strict mode future reserved keywords in a strict scope.
4597 void Parser::CheckConflictingVarDeclarations(Scope* scope, bool* ok) {
4598 Declaration* decl = scope->CheckConflictingVarDeclarations();