OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/debug-scopes.h" | 5 #include "src/debug/debug-scopes.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (scope_info->scope_type() != FUNCTION_SCOPE) { | 92 if (scope_info->scope_type() != FUNCTION_SCOPE) { |
93 // Global or eval code. | 93 // Global or eval code. |
94 Handle<Script> script(Script::cast(shared_info->script())); | 94 Handle<Script> script(Script::cast(shared_info->script())); |
95 info.reset(new ParseInfo(&zone, script)); | 95 info.reset(new ParseInfo(&zone, script)); |
96 info->set_toplevel(); | 96 info->set_toplevel(); |
97 if (scope_info->scope_type() == SCRIPT_SCOPE) { | 97 if (scope_info->scope_type() == SCRIPT_SCOPE) { |
98 info->set_global(); | 98 info->set_global(); |
99 } else { | 99 } else { |
100 DCHECK(scope_info->scope_type() == EVAL_SCOPE); | 100 DCHECK(scope_info->scope_type() == EVAL_SCOPE); |
101 info->set_eval(); | 101 info->set_eval(); |
102 info->set_context(Handle<Context>(function->context())); | 102 if (!function->context()->IsNativeContext()) { |
| 103 info->set_outer_scope_info(handle(function->context()->scope_info())); |
| 104 } |
103 // Language mode may be inherited from the eval caller. | 105 // Language mode may be inherited from the eval caller. |
104 // Retrieve it from shared function info. | 106 // Retrieve it from shared function info. |
105 info->set_language_mode(shared_info->language_mode()); | 107 info->set_language_mode(shared_info->language_mode()); |
106 } | 108 } |
107 } else { | 109 } else { |
108 // Inner function. | 110 // Inner function. |
109 info.reset(new ParseInfo(&zone, function)); | 111 info.reset(new ParseInfo(&zone, function)); |
110 } | 112 } |
111 if (Parser::ParseStatic(info.get()) && Rewriter::Rewrite(info.get())) { | 113 if (Parser::ParseStatic(info.get()) && Rewriter::Rewrite(info.get())) { |
112 DeclarationScope* scope = info->literal()->scope(); | 114 DeclarationScope* scope = info->literal()->scope(); |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); | 833 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); |
832 if (beg_pos <= position && position < end_pos) { | 834 if (beg_pos <= position && position < end_pos) { |
833 GetNestedScopeChain(isolate, inner_scope, position); | 835 GetNestedScopeChain(isolate, inner_scope, position); |
834 return; | 836 return; |
835 } | 837 } |
836 } | 838 } |
837 } | 839 } |
838 | 840 |
839 } // namespace internal | 841 } // namespace internal |
840 } // namespace v8 | 842 } // namespace v8 |
OLD | NEW |