Home | History | Annotate | Download | only in src

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;
620 { Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
621 info->SetGlobalScope(scope);
623 scope = Scope::DeserializeScopeChain(*info->context(), scope, zone());
626 if (!scope->is_global_scope() || info->language_mode() != CLASSIC_MODE) {
627 scope = NewScope(scope, EVAL_SCOPE);
630 scope = NewScope(scope, GLOBAL_SCOPE);
632 scope->set_start_position(0);
633 scope->set_end_position(source->length());
639 scope->is_eval_scope()) {
644 // Enters 'scope'.
645 FunctionState function_state(this, scope, isolate());
746 Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
747 info()->SetGlobalScope(scope);
749 scope = Scope::DeserializeScopeChain(info()->closure()->context(), scope,
752 FunctionState function_state(this, scope, isolate());
753 ASSERT(scope->language_mode() != STRICT_MODE || !info()->is_classic_mode());
754 ASSERT(scope->language_mode() != EXTENDED_MODE ||
757 scope->SetLanguageMode(shared_info->language_mode());
855 TargetScope scope(&this->target_stack_);
892 // TODO(mstarzinger): Global strict eval calls, need their own scope
894 // add this scope in DoParseProgram(), but that requires adaptations
899 Scope* scope = NewScope(top_scope_, EVAL_SCOPE);
900 scope->set_start_position(top_scope_->start_position());
901 scope->set_end_position(top_scope_->end_position());
902 top_scope_ = scope;
1043 Scope* scope = NewScope(top_scope_, MODULE_SCOPE);
1046 scope->set_start_position(scanner().location().beg_pos);
1047 scope->SetLanguageMode(EXTENDED_MODE);
1050 BlockState block_state(this, scope);
1064 scope->set_end_position(scanner().location().end_pos);
1065 body->set_scope(scope);
1068 Interface* interface = scope->interface();
1071 if (scope->LocalLookup(it.name()) == NULL) {
1154 Scope* scope = NewScope(top_scope_, MODULE_SCOPE);
1156 body->set_scope(scope);
1157 Interface* interface = scope->interface();
1161 interface->Unify(scope->interface(), zone(), ok);
1467 // truly local variable, and the scope of the variable is always the function
1468 // scope.
1470 // enclosing scope.
1480 Scope* declaration_scope = DeclarationScope(mode);
1483 // If a suitable scope exists, then we can statically declare this
1485 // will be added to the scope so that the declaration can be added
1487 // For instance declarations inside an eval scope need to be added
1489 // Similarly, strict mode eval scope does not leak variable declarations to
1490 // the caller's scope so we declare all locals, too.
1496 // Declare the variable in the declaration scope.
1497 // For the global scope, we have to check for collisions with earlier
1499 // global scope.
1511 // The name was declared in this scope before; check for conflicting
1513 // not a var (in the global scope, we also have to ignore legacy const for
1517 // conflicting declarations within the same scope. This check also covers
1522 // because the var declaration is hoisted to the function scope where 'x'
1572 // For variable declarations in a non-strict eval scope the proxy is bound
1586 // function scope and not a statement-local scope, e.g. as provided with a
1682 // other functions are set up when entering the surrounding scope.
1714 // scope, we treat it as such and introduce the function with its
1715 // initial value upon entering the corresponding scope.
1717 // global scope.
1735 // Note that a Block does not introduce a new execution scope!
1761 Scope* block_scope = NewScope(top_scope_, BLOCK_SCOPE);
1900 Scope* declaration_scope = DeclarationScope(mode);
1902 // The scope of a var/const declared variable anywhere inside a function
1905 // Scope declaration, and rewrite the source-level initialization into an
1942 // If we have a const declaration, in an inner scope, the proxy is always
1946 // pre-resolve the proxy because it resides in the same scope as the
1990 Scope* initialization_scope = is_const ? declaration_scope : top_scope_;
2088 // is always at the function scope level. This is only relevant for
2175 // from the top scope. This way, we don't try to resolve it
2176 // during the scope processing.
2333 Scope* declaration_scope = top_scope_->DeclarationScope();
2362 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE);
2485 Scope* catch_scope = NULL;
2705 // Create an in-between scope for let-bound iteration variables.
2706 Scope* saved_scope = top_scope_;
2707 Scope* for_scope = NewScope(top_scope_, BLOCK_SCOPE);
2773 // TODO(keuchel): Move the temporary variable to the block scope, after
3670 // Update the scope information before the pre-parsing bailout.
4282 Scope* scope =
4300 { FunctionState function_state(this, scope, isolate());
4322 scope->set_start_position(scanner().location().beg_pos);
4385 // - The outer scope must allow lazy compilation of inner functions.
4413 scope->set_end_position(entry.end_pos());
4416 scope->end_position() - function_block_pos);
4447 scope->set_end_position(logger.end());
4450 scope->end_position() - function_block_pos);
4508 scope->set_end_position(scanner().location().end_pos);
4514 int start_pos = scope->start_position();
4537 int start_pos = scope->start_position();
4553 CheckOctalLiteral(scope->start_position(),
4554 scope->end_position(),
4561 CheckConflictingVarDeclarations(scope, CHECK_OK);
4566 scope,
4747 // Parses an identifier that is valid for the current scope, in particular it
4748 // fails on strict mode future reserved keywords in a strict scope.
4838 void Parser::CheckConflictingVarDeclarations(Scope* scope, bool* ok) {
4839 Declaration* decl = scope->CheckConflictingVarDeclarations();