Home | History | Annotate | Download | only in src

Lines Matching refs:scope

328 Scope* Parser::NewScope(Scope* parent, ScopeType scope_type) {
329 Scope* result = new(zone()) Scope(parent, scope_type, zone());
446 Scope* scope) {
450 scope->DeclarationScope()->RecordEvalCall();
684 Scope* scope,
686 return factory->NewVariableProxy(scope->receiver());
714 Handle<String> name, int pos, Scope* scope,
723 return scope->NewUnresolved(factory, name, interface, pos);
863 { Scope* scope = NewScope(scope_, GLOBAL_SCOPE);
864 info->SetGlobalScope(scope);
866 scope = Scope::DeserializeScopeChain(*info->context(), scope, zone());
868 original_scope_ = scope;
870 if (!scope->is_global_scope() || info->strict_mode() == STRICT) {
871 scope = NewScope(scope, EVAL_SCOPE);
874 scope = NewScope(scope, GLOBAL_SCOPE);
876 scope->set_start_position(0);
877 scope->set_end_position(source->length());
883 scope->is_eval_scope()) {
888 // Enters 'scope'.
889 FunctionState function_state(&function_state_, &scope_, scope, zone());
998 Scope* scope = NewScope(scope_, GLOBAL_SCOPE);
999 info()->SetGlobalScope(scope);
1001 scope = Scope::DeserializeScopeChain(info()->closure()->context(), scope,
1004 original_scope_ = scope;
1005 FunctionState function_state(&function_state_, &scope_, scope, zone());
1006 ASSERT(scope->strict_mode() == SLOPPY || info()->strict_mode() == STRICT);
1008 scope->SetStrictMode(shared_info->strict_mode());
1056 TargetScope scope(&this->target_stack_);
1094 // TODO(mstarzinger): Global strict eval calls, need their own scope
1096 // add this scope in DoParseProgram(), but that requires adaptations
1101 Scope* scope = NewScope(scope_, EVAL_SCOPE);
1102 scope->set_start_position(scope_->start_position());
1103 scope->set_end_position(scope_->end_position());
1104 scope_ = scope;
1245 Scope* scope = NewScope(scope_, MODULE_SCOPE);
1248 scope->set_start_position(scanner()->location().beg_pos);
1249 scope->SetStrictMode(STRICT);
1252 BlockState block_state(&scope_, scope);
1266 scope->set_end_position(scanner()->location().end_pos);
1267 body->set_scope(scope);
1270 Interface* interface = scope->interface();
1273 if (scope->LookupLocal(it.name()) == NULL) {
1357 Scope* scope = NewScope(scope_, MODULE_SCOPE);
1359 body->set_scope(scope);
1360 Interface* interface = scope->interface();
1364 interface->Unify(scope->interface(), zone(), ok);
1650 // truly local variable, and the scope of the variable is always the function
1651 // scope.
1653 // enclosing scope.
1663 Scope* declaration_scope = DeclarationScope(mode);
1666 // If a suitable scope exists, then we can statically declare this
1668 // will be added to the scope so that the declaration can be added
1670 // For instance declarations inside an eval scope need to be added
1672 // Similarly, strict mode eval scope does not leak variable declarations to
1673 // the caller's scope so we declare all locals, too.
1679 // Declare the variable in the declaration scope.
1680 // For the global scope, we have to check for collisions with earlier
1682 // global scope.
1694 // The name was declared in this scope before; check for conflicting
1696 // not a var (in the global scope, we also have to ignore legacy const for
1700 // conflicting declarations within the same scope. This check also covers
1705 // because the var declaration is hoisted to the function scope where 'x'
1748 // For variable declarations in a sloppy eval scope the proxy is bound
1762 // function scope and not a statement-local scope, e.g. as provided with a
1839 // other functions are set up when entering the surrounding scope.
1874 // scope, we treat it as such and introduce the function with its
1875 // initial value upon entering the corresponding scope.
1877 // global scope.
1898 // Note that a Block does not introduce a new execution scope!
1926 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE);
2065 Scope* declaration_scope = DeclarationScope(mode);
2067 // The scope of a var/const declared variable anywhere inside a function
2070 // Scope declaration, and rewrite the source-level initialization into an
2100 // If we have a const declaration, in an inner scope, the proxy is always
2104 // pre-resolve the proxy because it resides in the same scope as the
2147 Scope* initialization_scope = is_const ? declaration_scope : scope_;
2246 // is always at the function scope level. This is only relevant for
2335 // from the top scope. This way, we don't try to resolve it
2336 // during the scope processing.
2491 Scope* decl_scope = scope_->DeclarationScope();
2519 Scope* with_scope = NewScope(scope_, WITH_SCOPE);
2644 Scope* catch_scope = NULL;
2876 Scope* inner_scope, ZoneStringList* names, ForStatement* loop,
2912 Scope* for_scope = scope_;
3045 // Create an in-between scope for let-bound iteration variables.
3046 Scope* saved_scope = scope_;
3047 Scope* for_scope = NewScope(scope_, BLOCK_SCOPE);
3115 // TODO(keuchel): Move the temporary variable to the block scope, after
3200 // for loop must be parsed in a new scope.
3201 Scope* inner_scope = NULL;
3341 // their declaration is hoisted, but they still see the local scope. E.g.,
3355 // - (1) is the case iff the innermost scope of the deserialized scope chain
3356 // under which we compile is _not_ a declaration scope. This holds because
3358 // declaration scope and compiled relative to that.
3359 // - (2) is the case iff the current declaration scope is still the original
3360 // one relative to the deserialized scope chain. Otherwise we must be
3361 // compiling a function in an inner declaration scope in the eval, e.g. a
3363 Scope* declaration_scope = scope_->DeclarationScope();
3364 Scope* original_declaration_scope = original_scope_->DeclarationScope();
3365 Scope* scope =
3384 { FunctionState function_state(&function_state_, &scope_, scope, zone());
3404 scope->set_start_position(scanner()->location().beg_pos);
3479 // - The outer scope must allow lazy compilation of inner functions.
3500 // possible reference to the variable in foo's scope. However, it's possible
3549 CheckOctalLiteral(scope->start_position(),
3550 scope->end_position(),
3558 CheckConflictingVarDeclarations(scope, CHECK_OK);
3566 scope,
3810 void Parser::CheckConflictingVarDeclarations(Scope* scope, bool* ok) {
3811 Declaration* decl = scope->CheckConflictingVarDeclarations();