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

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

Issue 1916343002: [debugger] do not expose temporary variables introduced by the parser. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « src/debug/debug-frames.cc ('k') | src/objects.h » ('j') | 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/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 } 794 }
795 795
796 796
797 void ScopeIterator::CopyContextLocalsToScopeObject( 797 void ScopeIterator::CopyContextLocalsToScopeObject(
798 Handle<ScopeInfo> scope_info, Handle<Context> context, 798 Handle<ScopeInfo> scope_info, Handle<Context> context,
799 Handle<JSObject> scope_object) { 799 Handle<JSObject> scope_object) {
800 Isolate* isolate = scope_info->GetIsolate(); 800 Isolate* isolate = scope_info->GetIsolate();
801 int local_count = scope_info->ContextLocalCount(); 801 int local_count = scope_info->ContextLocalCount();
802 if (local_count == 0) return; 802 if (local_count == 0) return;
803 // Fill all context locals to the context extension. 803 // Fill all context locals to the context extension.
804 int first_context_var = scope_info->StackLocalCount();
805 int start = scope_info->ContextLocalNameEntriesIndex();
806 for (int i = 0; i < local_count; ++i) { 804 for (int i = 0; i < local_count; ++i) {
807 if (scope_info->LocalIsSynthetic(first_context_var + i)) continue; 805 Handle<String> name(scope_info->ContextLocalName(i));
806 if (ScopeInfo::VariableIsSynthetic(*name)) continue;
808 int context_index = Context::MIN_CONTEXT_SLOTS + i; 807 int context_index = Context::MIN_CONTEXT_SLOTS + i;
809 Handle<Object> value = Handle<Object>(context->get(context_index), isolate); 808 Handle<Object> value = Handle<Object>(context->get(context_index), isolate);
810 // Reflect variables under TDZ as undefined in scope object. 809 // Reflect variables under TDZ as undefined in scope object.
811 if (value->IsTheHole()) continue; 810 if (value->IsTheHole()) continue;
812 // This should always succeed. 811 // This should always succeed.
813 // TODO(verwaest): Use AddDataProperty instead. 812 // TODO(verwaest): Use AddDataProperty instead.
814 JSObject::SetOwnPropertyIgnoreAttributes( 813 JSObject::SetOwnPropertyIgnoreAttributes(scope_object, name, value, NONE)
815 scope_object, handle(String::cast(scope_info->get(i + start))), value,
816 NONE)
817 .Check(); 814 .Check();
818 } 815 }
819 } 816 }
820 817
821 bool ScopeIterator::CopyContextExtensionToScopeObject( 818 bool ScopeIterator::CopyContextExtensionToScopeObject(
822 Handle<JSObject> extension, Handle<JSObject> scope_object, 819 Handle<JSObject> extension, Handle<JSObject> scope_object,
823 KeyCollectionType type) { 820 KeyCollectionType type) {
824 Handle<FixedArray> keys; 821 Handle<FixedArray> keys;
825 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 822 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
826 isolate_, keys, JSReceiver::GetKeys(extension, type, ENUMERABLE_STRINGS), 823 isolate_, keys, JSReceiver::GetKeys(extension, type, ENUMERABLE_STRINGS),
(...skipping 27 matching lines...) Expand all
854 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); 851 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden());
855 if (beg_pos <= position && position < end_pos) { 852 if (beg_pos <= position && position < end_pos) {
856 GetNestedScopeChain(isolate, inner_scope, position); 853 GetNestedScopeChain(isolate, inner_scope, position);
857 return; 854 return;
858 } 855 }
859 } 856 }
860 } 857 }
861 858
862 } // namespace internal 859 } // namespace internal
863 } // namespace v8 860 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug-frames.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698