Lines Matching refs:scope
410 Scope* Parser::NewScope(Scope* parent, ScopeType type) {
411 Scope* result = new(zone()) Scope(parent, type);
462 // FunctionState and BlockState together implement the parser's scope stack.
463 // The parser's current scope is in top_scope_. The BlockState and
464 // FunctionState constructors push on the scope stack and the destructors
470 BlockState(Parser* parser, Scope* scope)
473 parser->top_scope_ = scope;
480 Scope* outer_scope_;
485 Scope* scope,
497 parser->top_scope_ = scope;
605 { Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
606 info->SetGlobalScope(scope);
610 scope = Scope::DeserializeScopeChain(*info->calling_context(), scope);
612 if (!scope->is_global_scope() || info->language_mode() != CLASSIC_MODE) {
613 scope = NewScope(scope, EVAL_SCOPE);
616 scope->set_start_position(0);
617 scope->set_end_position(source->length());
618 FunctionState function_state(this, scope, isolate());
656 // and it is not safe to do so before the scope has been deleted.
707 Scope* scope = NewScope(top_scope_, GLOBAL_SCOPE);
708 info->SetGlobalScope(scope);
710 scope = Scope::DeserializeScopeChain(info->closure()->context(), scope);
712 FunctionState function_state(this, scope, isolate());
713 ASSERT(scope->language_mode() != STRICT_MODE || !info->is_classic_mode());
714 ASSERT(scope->language_mode() != EXTENDED_MODE ||
717 scope->SetLanguageMode(shared_info->language_mode());
737 // not safe to do before scope has been deleted.
827 InitializationBlockFinder(Scope* top_scope, Target* target)
953 void Update(Scope* scope, Statement* stat) {
963 HandleThisPropertyAssignment(scope, assignment);
1005 void HandleThisPropertyAssignment(Scope* scope, Assignment* assignment) {
1031 for (int i = 0; i < scope->num_parameters(); i++) {
1032 if (*scope->parameter(i)->name() == *name) {
1112 TargetScope scope(&this->target_stack_);
1146 // TODO(mstarzinger): Global strict eval calls, need their own scope
1148 // add this scope in DoParseProgram(), but that requires adaptations
1152 Scope* scope = NewScope(top_scope_, EVAL_SCOPE);
1153 scope->set_start_position(top_scope_->start_position());
1154 scope->set_end_position(top_scope_->end_position());
1155 top_scope_ = scope;
1312 Scope* scope = NewScope(top_scope_, MODULE_SCOPE);
1315 scope->set_start_position(scanner().location().beg_pos);
1316 scope->SetLanguageMode(EXTENDED_MODE);
1319 BlockState block_state(this, scope);
1335 scope->set_end_position(scanner().location().end_pos);
1336 body->set_block_scope(scope);
1338 scope->interface()->Freeze(ok);
1340 return factory()->NewModuleLiteral(body, scope->interface());
1703 // truly local variable, and the scope of the variable is always the function
1704 // scope.
1706 // enclosing scope.
1716 Scope* declaration_scope = DeclarationScope(mode);
1719 // If a function scope exists, then we can statically declare this
1721 // will be added to the scope so that the declaration can be added
1723 // For instance declarations inside an eval scope need to be added
1725 // Similarly, strict mode eval scope does not leak variable declarations to
1726 // the caller's scope so we declare all locals, too.
1734 // Declare the variable in the function scope.
1741 // The name was declared in this scope before; check for conflicting
1746 // conflicting declarations within the same scope. This check also covers
1750 // because the var declaration is hoisted to the function scope where 'x'
1811 // For variable declarations in a non-strict eval scope the proxy is bound
1828 // function scope and not a statement-local scope, e.g. as provided with a
1923 // other functions are set up when entering the surrounding scope.
1950 // scope, we treat is as such and introduce the function with it's
1951 // initial value upon entering the corresponding scope.
1968 // Note that a Block does not introduce a new execution scope!
1996 Scope* block_scope = NewScope(top_scope_, BLOCK_SCOPE);
2137 Scope* declaration_scope = DeclarationScope(mode);
2139 // The scope of a var/const declared variable anywhere inside a function
2142 // Scope declaration, and rewrite the source-level initialization into an
2179 // If we have a const declaration, in an inner scope, the proxy is always
2183 // pre-resolve the proxy because it resides in the same scope as the
2225 Scope* initialization_scope = is_const ? declaration_scope : top_scope_;
2320 // is always at the function scope level. This is only relevant for
2403 // from the top scope. This way, we don't try to resolve it
2404 // during the scope processing.
2553 Scope* declaration_scope = top_scope_->DeclarationScope();
2581 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE);
2703 Scope* catch_scope = NULL;
2837 // Create an in-between scope for let-bound iteration variables.
2838 Scope* saved_scope = top_scope_;
2839 Scope* for_scope = NewScope(top_scope_, BLOCK_SCOPE);
2895 // TODO(keuchel): Move the temporary variable to the block scope, after
3748 // Update the scope information before the pre-parsing bailout.
4396 Scope* scope = (type == FunctionLiteral::DECLARATION && !is_extended_mode())
4409 { FunctionState function_state(this, scope, isolate());
4415 scope->set_start_position(scanner().location().beg_pos);
4478 // - The outer scope must be trivial (only global variables in scope).
4507 scope->set_end_position(entry.end_pos());
4510 scope->end_position() - function_block_pos);
4543 scope->set_end_position(logger.end());
4546 scope->end_position() - function_block_pos);
4577 scope->set_end_position(scanner().location().end_pos);
4583 int start_pos = scope->start_position();
4606 int start_pos = scope->start_position();
4622 CheckOctalLiteral(scope->start_position(),
4623 scope->end_position(),
4630 CheckConflictingVarDeclarations(scope, CHECK_OK);
4635 scope,
4795 // Parses an identifier that is valid for the current scope, in particular it
4796 // fails on strict mode future reserved keywords in a strict scope.
4877 void Parser::CheckConflictingVarDeclarations(Scope* scope, bool* ok) {
4878 Declaration* decl = scope->CheckConflictingVarDeclarations();