Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: src/debug/debug-scopes.cc

Issue 2159113002: [debug] use correct language mode when parsing eval for scope iterator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Global or eval code. 90 // Global or eval code.
91 Handle<Script> script(Script::cast(shared_info->script())); 91 Handle<Script> script(Script::cast(shared_info->script()));
92 info.Reset(new ParseInfo(&zone, script)); 92 info.Reset(new ParseInfo(&zone, script));
93 info->set_toplevel(); 93 info->set_toplevel();
94 if (scope_info->scope_type() == SCRIPT_SCOPE) { 94 if (scope_info->scope_type() == SCRIPT_SCOPE) {
95 info->set_global(); 95 info->set_global();
96 } else { 96 } else {
97 DCHECK(scope_info->scope_type() == EVAL_SCOPE); 97 DCHECK(scope_info->scope_type() == EVAL_SCOPE);
98 info->set_eval(); 98 info->set_eval();
99 info->set_context(Handle<Context>(function->context())); 99 info->set_context(Handle<Context>(function->context()));
100 // Language mode may be inherited from the eval caller.
101 // Retrieve it from shared function info.
102 info->set_language_mode(shared_info->language_mode());
100 } 103 }
101 } else { 104 } else {
102 // Inner function. 105 // Inner function.
103 info.Reset(new ParseInfo(&zone, function)); 106 info.Reset(new ParseInfo(&zone, function));
104 } 107 }
105 Scope* scope = NULL; 108 Scope* scope = NULL;
106 if (Compiler::ParseAndAnalyze(info.get())) scope = info->literal()->scope(); 109 if (Compiler::ParseAndAnalyze(info.get())) scope = info->literal()->scope();
107 if (!ignore_nested_scopes) RetrieveScopeChain(scope); 110 if (!ignore_nested_scopes) RetrieveScopeChain(scope);
108 if (collect_non_locals) CollectNonLocals(scope); 111 if (collect_non_locals) CollectNonLocals(scope);
109 UnwrapEvaluationContext(); 112 UnwrapEvaluationContext();
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); 806 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden());
804 if (beg_pos <= position && position < end_pos) { 807 if (beg_pos <= position && position < end_pos) {
805 GetNestedScopeChain(isolate, inner_scope, position); 808 GetNestedScopeChain(isolate, inner_scope, position);
806 return; 809 return;
807 } 810 }
808 } 811 }
809 } 812 }
810 813
811 } // namespace internal 814 } // namespace internal
812 } // namespace v8 815 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698